2014-05-07 14:03:43 +01:00
|
|
|
# ab
|
|
|
|
|
2021-03-13 21:44:59 +00:00
|
|
|
> Apache HTTP server benchmarking tool.
|
|
|
|
> More information: <https://httpd.apache.org/docs/current/programs/ab.html>.
|
2014-05-07 14:03:43 +01:00
|
|
|
|
2020-01-29 11:53:07 +00:00
|
|
|
- Execute 100 HTTP GET requests to a given URL:
|
2014-05-07 14:03:43 +01:00
|
|
|
|
2018-11-03 10:30:41 +00:00
|
|
|
`ab -n {{100}} {{url}}`
|
2014-05-07 14:03:43 +01:00
|
|
|
|
2021-03-13 21:44:59 +00:00
|
|
|
- Execute 100 HTTP GET requests, in concurrent batches of 10, to a URL:
|
2014-05-07 14:03:43 +01:00
|
|
|
|
2018-11-03 10:30:41 +00:00
|
|
|
`ab -n {{100}} -c {{10}} {{url}}`
|
|
|
|
|
2021-03-13 21:44:59 +00:00
|
|
|
- Execute 100 HTTP POST requests to a URL, using a JSON payload from a file:
|
|
|
|
|
|
|
|
`ab -n {{100}} -T {{application/json}} -p {{path/to/file.json}} {{url}}`
|
|
|
|
|
|
|
|
- Use HTTP [K]eep Alive, i.e. perform multiple requests within one HTTP session:
|
2018-11-03 10:30:41 +00:00
|
|
|
|
|
|
|
`ab -k {{url}}`
|
|
|
|
|
|
|
|
- Set the maximum number of seconds to spend for benchmarking:
|
|
|
|
|
|
|
|
`ab -t {{60}} {{url}}`
|