3

I have a server which blocks burst request (if the same IP address accesses the server more than 3 times a second, it will serve 500 error).

So when I use Apache benchmark, I see a lot of failed requests, even when I set concurrency to 1.

Is there an option to set an interval between each request? Or is there similar benchmarking tools that offers this interval functionality?

lulalala
  • 1,677
  • 2
  • 13
  • 12

5 Answers5

5

You could run ab through watch to delay the repeated access, but you're not going to be able to use the report summary for much.

watch -n 1 ab -n 3 http://serverfault.com/

Or run it through curl instead of ab

watch -n 0.4 curl http://serverfault.com/

More about watch: http://www.linfo.org/watch.html

Ryan McGeary
  • 151
  • 1
  • 3
3

You can use hey instead.

It has similar syntax as apache bench.

hey -n 50 -q 1 -c 1 http://www.google.com 

sends 50 requests with a pause of 1 sec between.

Sven Dukat
  • 141
  • 2
3

You're really not going to accomplish any meaningful load testing with concurrency limited to 3. You probably need to remove the requests per second restriction for the IP that you're testing from.

Shane Madden
  • 114,520
  • 13
  • 181
  • 251
2

There is no such option.

Only configurable timing settings is

-t timelimit

Maximum number of seconds to spend for benchmarking. This implies a -n 50000 internally. Use this to benchmark the server within a fixed total amount of time. Per default there is no timelimit.

However, what is effect of benchmarking if you wait? You will not gain real results at all.

HopelessN00b
  • 53,795
  • 33
  • 135
  • 209
1

And you may add a text file to log verbosity.

watch -n 1 'ab -n 3 -v3 http://serverfault.com/ >> ab.txt'

You may count ocurrence of errors 5xx. In vim for example:

:%s/HTTP\/1.1 5//n

Or permanent moves 3xx

:%s/HTTP\/1.1 3//n

And then fine analyse your hosting for tunning performance.

CesareoAguirre
  • 191
  • 1
  • 3