Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

http parser should not buffer the complete request and response in memory #6679

Closed
adriansr opened this issue Mar 27, 2018 · 0 comments
Closed

Comments

@adriansr
Copy link
Contributor

Users have reported that the performance of packetbeat is poor when dealing with HTTP requests and responses with large bodies.

After a quick analysis of the HTTP parser it has been identified the case where the parser keeps the whole request and response (including bodies) in memory, even when it is not necessary.

adriansr added a commit to adriansr/beats that referenced this issue Apr 5, 2018
This patch updates the http protocol parser in packetbeat to not
buffer the full request/response.

Body is only buffered when neccesary, i.e. the `include_body_for`
option specifies that the body should be included in the event, or
a request body of type form-urlencoded is sent.

Fixes elastic#6679
@urso urso closed this as completed in #6680 Apr 5, 2018
urso pushed a commit that referenced this issue Apr 5, 2018
* HTTP benchmark for large bodies

A simple benchmark that processes a 10MB request.

* http: improve hide secrets unit test

It would not catch the case where the functionality to extract
form-urlencoded parameters is broken.

* http: add missing unit tests

Tests were missing for the following features:
- include_body_for
- send_request
- send_response

* http: remove unused parser state

* Reduce memory usage of http parser

This patch updates the http protocol parser in packetbeat to not
buffer the full request/response.

Body is only buffered when neccesary, i.e. the `include_body_for`
option specifies that the body should be included in the event, or
a request body of type form-urlencoded is sent.

Fixes #6679
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant