Fast HTTP benchmarking tool written in Node.js
npm install autocannon!demo
An HTTP/1.1 benchmarking tool written in node, greatly inspired by [wrk][wrk]
and [wrk2][wrk2], with support for HTTP pipelining and HTTPS.
On _my_ box, autocannon can produce more load than wrk and wrk2, see limitations for more details.
* Installation
* Usage
* API
* Acknowledgements
* License
```
npm i autocannon -g
or if you want to use the API or as a dependency:
``
npm i autocannon --save
`
Usage: autocannon [opts] URL
URL is any valid HTTP or HTTPS URL.
If the PORT environment variable is set, the URL can be a path. In that case 'http://localhost:$PORT/path' will be used as the URL.
Available options:
-c/--connections NUM
The number of concurrent connections to use. default: 10.
-p/--pipelining NUM
The number of pipelined requests to use. default: 1.
-d/--duration SEC
The number of seconds to run the autocannon. default: 10.
-a/--amount NUM
The number of requests to make before exiting the benchmark. If set, duration is ignored.
-L NUM
The number of milliseconds to elapse between taking samples. This controls the sample interval, & therefore the total number of samples, which affects statistical analyses. default: 1.
-S/--socketPath
A path to a Unix Domain Socket or a Windows Named Pipe. A URL is still required to send the correct Host header and path.
-w/--workers
Number of worker threads to use to fire requests.
-W/--warmup
Use a warm up interval before starting sampling.
This enables startup processes to finish and traffic to normalize before sampling begins
use -c and -d sub args e.g. --warmup [ -c 1 -d 3 ]localhost
--on-port
Start the command listed after -- on the command line. When it starts listening on a port,
start sending requests to that port. A URL is still required to send requests to
the correct path. The hostname can be omitted, will be used by default.node
If the command after -- is