Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ab is erroring out with apr_socket_recv: Connection refused (61)

Tags:

apachebench

I am testing eventlet out, and I am getting this error:

~>ab -n 10 -c 1 http://localhost:8090/
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking localhost (be patient)...apr_socket_recv: Connection reset by peer (54)
Total of 2 requests completed

The website works at localhost:8090/ and returns 200 OK.

I had the same issue with tomcat, again the website worked fine.

What could the issue be?

like image 498
Blankman Avatar asked Oct 29 '11 12:10

Blankman


2 Answers

I found using 127.0.0.1 rather than localhost worked:

ab -n 10 -c 1 http://127.0.0.1:8090/

Update: May have been a bug in ab: https://groups.google.com/forum/#!msg/nodejs/TZU5H7MdoII/yivu0d4LMaAJ

like image 50
dkam Avatar answered Dec 01 '22 01:12

dkam


New version's apache have fix the issue. Only have to rebuild ab.

Try to download latest package from http://archive.apache.org/dist/

Have to patch apache and build a new ab.

$ wget http://archive.apache.org/dist/httpd/httpd-2.3.16-beta.tar.bz2
$ tar jxvf httpd-2.3.16-beta.tar.bz2 
$ cd httpd-2.3.16-beta
$ ./configure

Only have to build ab, which located in support folder.

$ cd support
$ make
...
$ ./ab -n 10 -c 1 http://localhost:8090/

If your apache is very old, then patch it and build as above.

$ wget https://www.rtfm.ro/download/patches/ab.patch --no-check-certificate
$ patch -p0 < ./ab.patch

Done.

like image 26
Sun Liwen Avatar answered Dec 01 '22 01:12

Sun Liwen