Autocannon sends two extra bytes at the end of the body, breaking the protocol
See original GitHub issueIβve tested uWS HTTP server and passed little body in every http request. It produced strange results. I asked (https://github.com/uNetworking/uWebSockets.js/issues/228) creator of uWS why it happens and he researched what "autocannon sends two extra bytes at the end of the body, breaking the protocol. uWebSockets does not close the connection immediately, as it has a different parsing strategy. "
Can you fix it, please?
$ autocannon -c 100 -p 100 -d 10 -m POST -b '{"a":1}' http://0.0.0.0:8080
Running 10s test @ http://0.0.0.0:8080
100 connections with 100 pipelining factor
βββββββββββ¬βββββββ¬βββββββ¬ββββββββ¬ββββββββ¬βββββββββββ¬βββββββββββ¬βββββββββββββ
β Stat β 2.5% β 50% β 97.5% β 99% β Avg β Stdev β Max β
βββββββββββΌβββββββΌβββββββΌββββββββΌββββββββΌβββββββββββΌβββββββββββΌβββββββββββββ€
β Latency β 0 ms β 0 ms β 56 ms β 82 ms β 13.01 ms β 34.33 ms β 3618.88 ms β
βββββββββββ΄βββββββ΄βββββββ΄ββββββββ΄ββββββββ΄βββββββββββ΄βββββββββββ΄βββββββββββββ
βββββββββββββ¬ββββββ¬βββββββ¬βββββββββ¬βββββββββ¬βββββββββ¬ββββββββββ¬ββββββββββ
β Stat β 1% β 2.5% β 50% β 97.5% β Avg β Stdev β Min β
βββββββββββββΌββββββΌβββββββΌβββββββββΌβββββββββΌβββββββββΌββββββββββΌββββββββββ€
β Req/Sec β 0 β 0 β 1253 β 3683 β 1655.6 β 1489.25 β 26 β
βββββββββββββΌββββββΌβββββββΌβββββββββΌβββββββββΌβββββββββΌββββββββββΌββββββββββ€
β Bytes/Sec β 0 B β 0 B β 231 kB β 678 kB β 305 kB β 274 kB β 4.78 kB β
βββββββββββββ΄ββββββ΄βββββββ΄βββββββββ΄βββββββββ΄βββββββββ΄ββββββββββ΄ββββββββββ
Req/Bytes counts sampled once per second.
17k requests in 10.15s, 3.05 MB read
7k errors (0 timeouts)
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
api documentation for autocannon (v0.16.5)
requestIterator (requests, defaults); function autocannon.run (opts, cb) ... setHeadersAndBody(headers, body)`: Used to modify the both the headers and body ...
Read more >hex - Decoding Thrift Object what are these extra bytes?
Everything sent and everything returned in a Thrift RPC call is packaged in a struct. Every field in a struct has a 1...
Read more >Exploring the quality attribute and performance ...
about data fetching, focusing more on the experience for the API consumer. ... The open source HTTP benchmarking tool AutoCannon [2] was used...
Read more >X-COM: UFO Defense Strategy Guide v1.11 - Csabi_B
Title: Strategy Guide 1.11 for X-COM: Enemy Unknown (PSX) Description: Strategic and tactical tips and lists. Revision Log: 1.11 I added ...
Read more >Ruleset Reference Nightly (OpenXcom)
Determines number and type of starting X-Com soldiers. If a mod contains more than one type of soldiers, this can also be specified...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
You can clearly see in Wireshark that autocannon sends invalid HTTP in the case of post. It sends Content-length: 7 followed by 7 bytes of content followed by 2 invalid bytes, breaking the protocol, causing the connection to eventually fail
It works just fine in wrk, https://github.com/wg/wrk as that client actually follows HTTP.
The protocol is like this:
header: value rn header: value rn rnrn content
but autocannon sends
header: value rn header: value rn rnrn content rn <- those shouldnβt be there, they break the protocol, botching the entire benchmark as things deteriorate to HTTP1.0 kind of connection close
Oh, it looks like youβre correct. Thanks for investigating. We add those /r/n for simpler logic for pipelining reasons, I think. I donβt think we realised it was invalid. Iβll put together a fix.
Thanks again!
On Wed 20 Nov 2019, 3:34 p.m. Matteo Collina, notifications@github.com wrote: