2014-05-07 16:03:43 +03:00
|
|
|
# ab
|
|
|
|
|
2021-03-13 16:44:59 -05:00
|
|
|
> Apache HTTP server benchmarking tool.
|
|
|
|
> More information: <https://httpd.apache.org/docs/current/programs/ab.html>.
|
2014-05-07 16:03:43 +03:00
|
|
|
|
2020-01-29 13:53:07 +02:00
|
|
|
- Execute 100 HTTP GET requests to a given URL:
|
2014-05-07 16:03:43 +03:00
|
|
|
|
2023-12-31 04:18:26 -03:00
|
|
|
`ab -n 100 {{url}}`
|
2014-05-07 16:03:43 +03:00
|
|
|
|
2021-03-13 16:44:59 -05:00
|
|
|
- Execute 100 HTTP GET requests, in concurrent batches of 10, to a URL:
|
2014-05-07 16:03:43 +03:00
|
|
|
|
2023-12-31 04:18:26 -03:00
|
|
|
`ab -n 100 -c 10 {{url}}`
|
2018-11-03 07:30:41 -03:00
|
|
|
|
2021-03-13 16:44:59 -05:00
|
|
|
- Execute 100 HTTP POST requests to a URL, using a JSON payload from a file:
|
|
|
|
|
2023-12-31 04:18:26 -03:00
|
|
|
`ab -n 100 -T {{application/json}} -p {{path/to/file.json}} {{url}}`
|
2021-03-13 16:44:59 -05:00
|
|
|
|
2023-12-03 19:59:57 +07:00
|
|
|
- Use HTTP [k]eep-Alive, i.e. perform multiple requests within one HTTP session:
|
2018-11-03 07:30:41 -03:00
|
|
|
|
|
|
|
`ab -k {{url}}`
|
|
|
|
|
2024-02-09 10:55:36 -03:00
|
|
|
- Set the maximum number of seconds ([t]imeout) to spend for benchmarking (30 by default):
|
2018-11-03 07:30:41 -03:00
|
|
|
|
|
|
|
`ab -t {{60}} {{url}}`
|
2023-12-31 04:18:26 -03:00
|
|
|
|
|
|
|
- Write the results to a CSV file:
|
|
|
|
|
|
|
|
`ab -e {{path/to/file.csv}}`
|