Posted by & filed under OS X.

I’m trying to make use of the latest version of ApacheBench (2.4.3) to perform some benchmarking against my local server. Unfortunately, it seems to be broke as hell.

$ ab -n 100000 http://localhost:3000/analytics
This is ApacheBench, Version 2.3 <$Revision: 1373084 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd,
Licensed to The Apache Software Foundation,

Benchmarking localhost (be patient)
apr_socket_recv: Connection refused (61)

Interestingly, the output of the command tells me that I’m using ab 2.3, when the HomeBrew build version is 2.4.3:

brew info ab
ab: stable 2.4.3

I find that ApacheBench generally doesn’t work very well, especially under OS X. There’s all sorts of quirks (If benchmarking the root of a site, a slash must be added or ab will error out). The most annoying part is that OS X doesn’t have a good way to allow more open ports from a single process.

Does anyone know how to get this tool working again? Or, does anyone know of a better alternative?

Thomas Hunter II

Support Thomas on Patreon. Thomas is the author of Advanced Microservices and a prolific public speaker with a passion for reducing complex problems into simple language and diagrams. His career includes working at Fortune 50's in the Midwest, co-founding a successful startup, and everything in between.