-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Add library option to disable saving response bodies #325
Comments
Thanks for reporting this with such useful context. Out of curiosity, would test your servers with HEAD instead of GET solve the issue? Or do they not handle that method? |
I didn't consider using HEAD requests, but in this case I don't think it would work. I'm mainly interested in how the server and the reverse proxy handle the data transfer as we adjust things like buffer settings or file system configuration. For that, it's important to send the file content to the client. |
This change set introduces a `-max-body` flag in the attack command as well as the corresponding `vegeta.MaxBody` functional option to use with `vegeta.NewAttacker`. Fixes #325
This change set introduces a `-max-body` flag in the attack command as well as the corresponding `vegeta.MaxBody` functional option to use with `vegeta.NewAttacker`. Fixes #325
Feedback welcome :-) |
Thanks for the quick turnaround on this. I haven't tested it out yet, but looking at the implementation I'm a bit worried that when setting the max body size to 0, the |
Proposal
Add an option for
Attacker
that does not save the response body into a buffer, but copies it directly toioutil.Discard
. I've implemented this in my fork: https://github.com/bluekeyes/vegeta/tree/bluekeyes/discard-bodyBackground
This is similar to #302, but slightly different. I'm using Vegeta as a library to test a download server, with file sizes ranging from 1kb to several GB. While the latest version of the CLI allows me to filter out the body from result files (or I could set the body to
nil
when using the library and processing results), reading large responses quickly uses up available memory during the test.For the largest downloads in my test (0.25GB - 4GB), my test containers were running out of memory unpredictably based on the download rate (I tested with up to 8GB of available memory.) Since I don't use the response body for anything, discarding it keeps the memory usage low and allows the large tests to run with the same system resources as tests for smaller files.
Workarounds
Running tests on hosts with more memory or distributing the load across more machines can solve this problem, but is wasteful and may be hard to setup.
The text was updated successfully, but these errors were encountered: