Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to ignore timeouts in ab (apache bench)?

I run benchmarks with apache bench on a web service. I know that 1-2 requests from the test will be timeouted during measurement (it's a web framework issue). And when timeout occurs ab quits with the message apr_pollset_poll: The timeout specified has expired (70007) and does not show results. I want to get measurement results ignoring these timeouted tests (or count them too, but just use timeout value as response time). Is it possible with ab?

EDIT: The command I use is

ab -n 1000 -c 10 http://localhost:80

I looked into ab source and from what I saw it's impossible to ignore these errors. Maybe there is a fork which implements such feature?

like image 995
Sergey Zhukov Avatar asked Sep 20 '16 09:09

Sergey Zhukov


People also ask

How Apache bench works?

ApacheBench allows you to configure the number of requests to send, a timeout limit, and request headers. ab will send the requests, wait for a response (up to a user-specified timeout), and output statistics as a report.

What is Apache benchmark tool?

ab is a tool for benchmarking your Apache Hypertext Transfer Protocol (HTTP) server. It is designed to give you an impression of how your current Apache installation performs. This especially shows you how many requests per second your Apache installation is capable of serving.

What is ApacheBench command line utility?

Apache Bench (ab) is a load testing and benchmarking tool for Hypertext Transfer Protocol (HTTP) server. It can be run from command line and it is very simple to use. A quick load testing output can be obtained in just one minute.


1 Answers

The default timeout is 30 seconds. You can change this with -s:

ab -s 9999 -n 1000 -c 10 http://localhost:80
like image 155
earldouglas Avatar answered Sep 20 '22 07:09

earldouglas