in reply to Benchmarking Perl's Net::Async::FastCGI app consistently return LOTS of "Non-2xx responses"

Edit: I found the answer to the problem described below was to use 127.0.0.1 rather than localhost (on MacOS).

I got the same results:

Concurrency Level: 50 Time taken for tests: 0.040 seconds Complete requests: 100 Failed requests: 0 Non-2xx responses: 57 Total transferred: 44998 bytes HTML transferred: 28931 bytes Requests per second: 2507.33 [#/sec] (mean)
The Non-2xx responses were 502s.

I tried fiddling with the proxy settings, but it made no difference.

Hope this helps.

Original comment:

More instructions needed. The fastcgi script is serving the /helloworld content when I use curl -L (it's returning a 301), but when I use Apache Bench I get apr_socket_connect(): Invalid argument (22). There's also no file at /tmp/myUDS.sock (which is where I configured it in nginx conf and in the Async script).


The way forward always starts with a minimal test.
  • Comment on Re: Benchmarking Perl's Net::Async::FastCGI app consistently return LOTS of "Non-2xx responses"
  • Select or Download Code

Replies are listed 'Best First'.
Re^2: Benchmarking Perl's Net::Async::FastCGI app consistently return LOTS of "Non-2xx responses"
by Anonymous Monk on Dec 05, 2025 at 13:33 UTC
    try to include the front slash at the end also, ex: http://localhost:<port>/helloworld/ . As for the location of the unix sock file, maybe try to save it at your home folder instead of /tmp to guarantee it can write to such location ??

      This turned out to be a MacOS vagary: I had to use 127.0.0.1 instead of localhost for AB to work.


      The way forward always starts with a minimal test.

        localhost might be defined as ::1 (IPv6) instead of 127.0.0.1 (IPv4).