mcollina / autocannon

fast HTTP/1.1 benchmarking tool written in Node.js
MIT License
7.83k stars 325 forks source link

Why could autocannon produce more requests than wrk? #109

Closed diorahman closed 7 years ago

diorahman commented 7 years ago

Thanks for providing such a great tool for benchmarking.

What is the underlying explanation on the capability of autocannon to produce so many requests? Is that because of its internal httpClient? I could find that autocannon does not use the standard http.request() to initiate the request, why is that?

Thanks!

mcollina commented 7 years ago

Because it uses a different concurrency model, and it supports HTTP pipelining. We use a custom HTTP client that allows us to avoid any data allocation to send a new request.

diorahman commented 7 years ago

Thanks, @mcollina!

subomi commented 7 years ago

@mcollina this is about event loops against threads?

mcollina commented 7 years ago

@Subomi yes, and autocannon supports HTTP/1.1 pipelining.

subomi commented 7 years ago

Thanks ..