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

后端 未结 5 1836
一生所求
一生所求 2020-12-23 18:56

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 $>         


        
5条回答
  •  醉梦人生
    2020-12-23 19:04

    Another related bug that is still present in ab (apache-2.4.29) is that it takes just the first result from getaddrinfo. It's probably this bug that is mentioned by Jürgen Strobel in a comment. Let's say you have /etc/hosts that goes like this:

    127.0.0.1   localhost.localdomain   localhost
    ::1     localhost.localdomain   localhost
    

    The first result returned by getaddrinfo for localhost is ::1. So ab tries to connect over IPv6 and fails. The workaround is to use 127.0.0.1: ab -n 10 127.0.0.1/. Or reorder the lines. Though, in my case it says:

    Benchmarking localhost (be patient)...apr_socket_recv: Connection refused (111)
    

提交回复
热议问题