-
Notifications
You must be signed in to change notification settings - Fork 10
Add option to not pass HTTP body to lua script #4
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
Conversation
This change makes multi-endpoint support more generic, with the motivation of making this feature useful for upstream. The LUA script 'multiple-endpoints.lua' allows for specifying an arbitrary number of HTTP(S) endpoints to include in the benchmark. Endpoints will be connected to in a random, evenly distributed fashion. After a run finished, the overall latency will be reported (i.e. there's currently no break-down per endpoint). The main purpose of running a benchmark over multiple endpoints is to allow benchmarking of e.g. a whole web application instead of the pages and/or restful resources that make up said application individually. Signed-off-by: Thilo Fromm <thilo@kinvolk.io>
This change removes passing HTTP response bodies to LUA scripts (the body is read and then discarded) and adds a script designed to stress CDN caches. Note that the cache stresser needs a high-throughput NIC to actually stress CDN cahces.
…ti-endpoint-support
margamanterola
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a few nitpicks with regards to the documentation. Otherwise, LGTM
SCRIPTING
Outdated
| global response -- called with HTTP response data | ||
| global response -- called with HTTP response header and body | ||
| (with --lua-dont-pass-body command line option | ||
| the body is omitted) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I find this phrasing a bit confusing. How about "(only the response header is passed if --lua-dont-pass-body is enabled)? Or maybe "(the body is omitted if --lua-dont-pass-body is enabled)"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll rephrase to "(body does not contain actual response data if the command line option --lua-dont-pass-body is used)".
SCRIPTING
Outdated
| nil after the call to init() wrk will ignore the headers and body. | ||
| Using wrk's --lua-dont-pass-body command line option will cause a "dummy" | ||
| body to be parsed instead of the actual body. The option is useful e.g. for | ||
| benchmarking endpoints which pass large response bodies, like caching |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The "like caching server" part seems out of place. You could be benchmarking a caching server that caches small responses. I suggest deleting that last part.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense, will remove the caching server reference.
docker/README.md
Outdated
| $ docker build -t cache-stresser -f docker/Dockerfile.cache-stresser . | ||
| ``` | ||
|
|
||
| After the build concluded, you may push the image to the registry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This "concluded" sounds weird, it's past tense for something that's actually in the future... I think "is done" would sound better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The whole sentence feels out of place; I'll remove the registry reference altogether.
docker/README.md
Outdated
| cache server in the above example), with an overall of 10 requests per second - | ||
| that's 1 request per second, per connection. The stress test duration is 60 seconds by default. | ||
|
|
||
| While the test is running it will display throughput per interface via the `nload` utility. After the test concluded, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment about "concluded" here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense, will change the wording.
14d0bcc to
661217d
Compare
This PR adds a command line option to not pass HTTP response bodies to a LUA script. The new option,
--lua-dont-pass-body, makeswrk2perform significantly better when benchmarking endpoints that return large HTTP bodies, like e.g. CDN / caching servers.The PR is based on the multi-endpoint / multi-server benchmark branch and is a clean implementation of the experimental cache stresser branch, which it obsoletes.
The PR aims to be merged into
masterso as to not pollute the multi-endpoint branch, which is used in an upstream PR.Also, a docker file is provided to build a
wrk2container image particularly aimed at running CDN cache stress benchmarks.how to use
As per the readme: