autocannon
autocannon copied to clipboard
All post-run stats are zero
What am I doing wrong with this? When I run this: autocannon -c 100 -d 20 -p 10 -l <my_url>
All the post-run stats show up like this:
┌─────────┬──────┬──────┬───────┬──────┬──────┬───────┬──────┐ │ Stat │ 2.5% │ 50% │ 97.5% │ 99% │ Avg │ Stdev │ Max │ ├─────────┼──────┼──────┼───────┼──────┼──────┼───────┼──────┤ │ Latency │ 0 ms │ 0 ms │ 0 ms │ 0 ms │ 0 ms │ 0 ms │ 0 ms │ └─────────┴──────┴──────┴───────┴──────┴──────┴───────┴──────┘ ┌───────────┬─────┬──────┬─────┬───────┬─────┬───────┬─────┐ │ Stat │ 1% │ 2.5% │ 50% │ 97.5% │ Avg │ Stdev │ Min │ ├───────────┼─────┼──────┼─────┼───────┼─────┼───────┼─────┤ │ Req/Sec │ 0 │ 0 │ 0 │ 0 │ 0 │ 0 │ 0 │ ├───────────┼─────┼──────┼─────┼───────┼─────┼───────┼─────┤ │ Bytes/Sec │ 0 B │ 0 B │ 0 B │ 0 B │ 0 B │ 0 B │ 0 B │ └───────────┴─────┴──────┴─────┴───────┴─────┴───────┴─────┘ Req/Bytes counts sampled once per second.
┌────────────┬──────────────┐ │ Percentile │ Latency (ms) │ ├────────────┼──────────────┤ │ 0.001 │ 0 │ ├────────────┼──────────────┤ │ 0.01 │ 0 │ ├────────────┼──────────────┤ │ 0.1 │ 0 │ ├────────────┼──────────────┤ │ 1 │ 0 │ ├────────────┼──────────────┤ │ 2.5 │ 0 │ ├────────────┼──────────────┤ │ 10 │ 0 │ ├────────────┼──────────────┤ │ 25 │ 0 │ ├────────────┼──────────────┤ │ 50 │ 0 │ ├────────────┼──────────────┤ │ 75 │ 0 │ ├────────────┼──────────────┤ │ 90 │ 0 │ ├────────────┼──────────────┤ │ 97.5 │ 0 │ ├────────────┼──────────────┤ │ 99 │ 0 │ ├────────────┼──────────────┤ │ 99.9 │ 0 │ ├────────────┼──────────────┤ │ 99.99 │ 0 │ ├────────────┼──────────────┤ │ 99.999 │ 0 │ └────────────┴──────────────┘
likely the sever never responded.
I'm running it against a local API built in .NET Core and it's hitting breakpoints and returning data. I tried a couple different API calls and test durations and always get zeroes.
If you disable the breakpoints, does it show the data?
If you mean does it show data in the autocannon output no, but the data is in "model" in the "return Ok(model)" of the controller action. Also, making a call to my URL in Postman does return the data fine. In addition, I did deploy it to our server to see if there was a local issue but got the same zeroes result. While running it I also monitored the server and it is definitely doing its job of providing a load. I was able to bring down my server API with it. :-)
BTW, I'm running on MacOS Catalina 10.15.5.
I think the problems is that not all the requests are coming back successfully. Because I'm overloading the API, some responses come back as 504 while others are successful. If I give it a lighter load that it can handle the metrics display fine. Could the intermittent 504s be messing up the metrics?
Have you tried removing pipelining?
Yes, I removed pipelining but still get zeroes if I overload the server too much with concurrent connections.
I'm experiencing the same issue. For context running ab
(Apache Benchmark) on same server yields expected results
Ran into the same issue. Turned out it was because the server was not setting a Content-Length
, so apparently autocannon kept waiting for the request to end. The fix was setting the Content-Length
.
This is a nice find. I'd take note next time I use autocannon. Should this really be an issue especially if the response isn't chunked?
On Wed, 19 May 2021, 15:38 Shalvah, @.***> wrote:
Ran into the same issue. Turned out it was because the server was not setting a Content-Length, so apparently autocannon kept waiting for the request to end. The fix was setting the Content-Length.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/mcollina/autocannon/issues/273#issuecomment-844168407, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHDNOO7FRFUPSDLEOBFIJULTOPENPANCNFSM4PSSCLUA .
I was surprised too. Even though the connection was being closed after sending the response. Clients like Insomnia correctly stopped, but autocannon kept waiting.
I am facing the same issue. Browsers are getting response but autocannon showing zero
100 connections with 10 pipelining factor
┌─────────┬──────┬──────┬───────┬──────┬──────┬───────┬──────┐ │ Stat │ 2.5% │ 50% │ 97.5% │ 99% │ Avg │ Stdev │ Max │ ├─────────┼──────┼──────┼───────┼──────┼──────┼───────┼──────┤ │ Latency │ 0 ms │ 0 ms │ 0 ms │ 0 ms │ 0 ms │ 0 ms │ 0 ms │ └─────────┴──────┴──────┴───────┴──────┴──────┴───────┴──────┘ ┌───────────┬─────┬──────┬─────┬───────┬─────┬───────┬─────┐ │ Stat │ 1% │ 2.5% │ 50% │ 97.5% │ Avg │ Stdev │ Min │ ├───────────┼─────┼──────┼─────┼───────┼─────┼───────┼─────┤ │ Req/Sec │ 0 │ 0 │ 0 │ 0 │ 0 │ 0 │ 0 │ ├───────────┼─────┼──────┼─────┼───────┼─────┼───────┼─────┤ │ Bytes/Sec │ 0 B │ 0 B │ 0 B │ 0 B │ 0 B │ 0 B │ 0 B │ └───────────┴─────┴──────┴─────┴───────┴─────┴───────┴─────┘
Req/Bytes counts sampled once per second.
0 requests in 5.04s, 0 B read
To all folks that read this: posting "me too" here will not help. Sending a PR to fix it will. Another great way is to write a server in Node.js that can be used to reliably generate this output.
Agree. The fix should be for autocannon to count a request as ended when the connection is closed. I'll try to work on it when I have time. Autocannon's a great tool, btw.
Thanks!