ApacheBench fails after Mac OSX Lion Upgrage apr_socket_recv: Connection reset by peer (54)
August 23rd, 2011At work I have been using ApacheBench to help bench mark performance. It is a fabulous tool. After upgrading my OS to Lion, ApacheBench (ab) fails to run. Here was my error:
Scott ~/src: ab -n 5000 -c 100 http://127.0.0.1:3000/ 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 127.0.0.1 (be patient) Send request failed! apr_socket_recv: Connection reset by peer (54)
Apparently there is a patch to fix it, here, but I could not get it to work. That and the post is in another language, that google did a sos-so job of translating. I had read somewhere that this was fixed in new version of apache, version 2.3.14 (download here), which is in beta. I didn’t need to (or want to) install all of Apache, just ApacheBench so I compiled the source and copied over the binary. Here are the steps:
Scott ~/Desktop: cp ./support/.libs/ab /usr/local/apache2/bin/ab ./configure --prefix=/usr/local/apache2 make make install which ab output --> /usr/sbin/ab cd /usr/local/apache2/bin/ cp ab /usr/sbin/ab sudo cp ab /usr/sbin/ab
Success! Back to normal, everything is working again.
