57

I'm load testing IIS 7.5 (WinR2/SP1) from my Windows 7/SP1 client. I have a script that makes three ab calls like:

start /B cmd /c ab.exe -k -n 500 -c 50 http://rhvwr2vsu410/HelloWebAPI/Home/SyncProducts > SyncProducts.txt

When the concurrency is > 5, I soon get the error message

apr_poll: The timeout specified has expired (70007)

And ab stops making requests. I don't even get to Completed 100 requests.

This happens within 30 seconds of starting my script. The ab documentation page doesn't provide much. Related Stack Overflow question. Server Fault related question .

Lumito
  • 490
  • 6
  • 20
RickAndMSFT
  • 20,912
  • 8
  • 60
  • 78
  • 1
    A similar thing happened to me as well. The problem was related to my code. Not sure if this is the case here, though. – tugberk Apr 17 '12 at 07:38
  • @tugberk - exactly, a bug in my WebApi code limited concurrency. As soon as I fixed the bug the apr_poll message went away. – RickAndMSFT Apr 21 '12 at 01:15
  • You can try the solution given in this thread: http://serverfault.com/questions/10852/what-limits-the-maximum-number-of-connections-on-a-linux-server – Sivaraman Viswanathan Sep 03 '12 at 09:20
  • I think this question is old, but I am still getting this problem from the command line, e.g. `ab http://myinternalserver.tld/file.txt` but it works when I add `-X 127.0.0.1:8888` to go through my local debug proxy and it works using curl. Any clues? – jacobq Mar 11 '14 at 20:34

4 Answers4

32

You must have the 2.4 version and use -s timeout option.

Edit:

https://www.wampserver.com/ - includes Apache 2.4.x Win32 and Win64.

Deprecated but still available however I not known until when and just not available:

You can use my win32-x86 binary (compiled under Visual Studio 2008 from trunk 8 Feb 2013):

  • http://mars.iti.pk.edu.pl/~nkg/ab-standalone.exe (no longer available)
  • http://mars.iti.pk.edu.pl/~nkg/ab-standalone-src.zip (no longer available)

I was made it using: http://code.google.com/p/apachebench-standalone/wiki/HowToBuild and http://ftp.ps.pl/pub/apache//apr/binaries/win32/apr-1.3.6-iconv-1.2.1-util-1.3.8-win32-x86-msvcrt60.zip (just not available).

Dzwiedziu-nkg
  • 703
  • 6
  • 19
17
ab --help 

-s timeout      Seconds to max. wait for each response
                    Default is 30 seconds

Add option: -s 120 to ab command, Where 120 is new timeout. If it is not enough set it even higher...

smentek
  • 2,820
  • 1
  • 28
  • 32
12

ab --help

-s      timeout      Seconds to max. wait for each response
                    Default is 30 seconds

-k                    Use HTTP KeepAlive feature

It works for me

Anurag jain
  • 2,281
  • 1
  • 11
  • 10
8

Sounds like an ab bug.

I had a similar problem on OS X (now that you mention it happens on Windows, I feel more confident that ab is the culprit). I went around profiling and tracing my web application, but couldn't find anything. I then tested static pages off of nginx, and it still gave me the error. So I then went and found a replacement... jMeter. Works great, but I would still like to know what the ab problem is.

iconoclast
  • 21,213
  • 15
  • 102
  • 138
Matt
  • 978
  • 10
  • 24
  • 2
    I'm wondering the same. In my situation I'm using high concurrency and the failure isn't reproducible, but consistently -n minus 2. e.g. ab -c 500 -n 10000 => 9998 complete, 2 timeout. Maybe related: https://bz.apache.org/bugzilla/show_bug.cgi?id=22686 – Cory Mawhorter Mar 31 '15 at 19:47