Red Hat Bugzilla – Bug 1125269
ab fails when domain name resolved to IPv6 adress
Last modified: 2016-04-18 06:27:05 EDT
Description of problem: When ab is run for a domain name which resolves to an IPv6 address first, it exits with failure even if the domain name can be resolved to an IPv4, too: -------------------------------------------------------------------------------- $ ab http://www.apache.org/ 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 www.apache.org (be patient)...apr_socket_recv: Network is unreachable (101) -------------------------------------------------------------------------------- This error message is similar to the one printed by wget for the same URL in the first phase. Unlike ab, wget tries to resolve the domain name to IPv4 once IPv6 has failed: -------------------------------------------------------------------------------- $ wget http://www.apache.org/ --2014-07-31 08:51:58-- http://www.apache.org/ Resolving www.apache.org... 2001:610:1:80bc:192:87:106:229, 192.87.106.229, 140.211.11.131 Connecting to www.apache.org|2001:610:1:80bc:192:87:106:229|:80... failed: Network is unreachable. Connecting to www.apache.org|192.87.106.229|:80... connected. HTTP request sent, awaiting response... 200 OK Length: 41041 (40K) [text/html] Saving to: `index.html' 100%[======================================>] 41,041 97.2K/s in 0.4s 2014-07-31 08:51:59 (97.2 KB/s) - `index.html' saved [41041/41041] -------------------------------------------------------------------------------- It seems that ab works fine exactly for those domain names which resolve to IPv4 only, i.e. those which are not resolved to IPv6 first: -------------------------------------------------------------------------------- $ ab http://www.redhat.com/ This is ApacheBench, Version 2.3 <$Revision: 1430300 $> Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ Licensed to The Apache Software Foundation, http://www.apache.org/ Benchmarking www.redhat.com (be patient).....done Server Software: Apache-Coyote/1.1 Server Hostname: www.redhat.com Server Port: 80 Document Path: / Document Length: 75730 bytes Concurrency Level: 1 Time taken for tests: 1.705 seconds Complete requests: 1 Failed requests: 0 Write errors: 0 Total transferred: 76285 bytes HTML transferred: 75730 bytes Requests per second: 0.59 [#/sec] (mean) Time per request: 1705.085 [ms] (mean) Time per request: 1705.085 [ms] (mean, across all concurrent requests) Transfer rate: 43.69 [Kbytes/sec] received Connection Times (ms) min mean[+/-sd] median max Connect: 47 47 0.0 47 47 Processing: 1658 1658 0.0 1658 1658 Waiting: 1436 1436 0.0 1436 1436 Total: 1705 1705 0.0 1705 1705 $ wget http://www.redhat.com/ --2014-07-31 15:03:44-- http://www.redhat.com/ Resolving www.redhat.com (www.redhat.com)... 2.17.39.214 Connecting to www.redhat.com (www.redhat.com)|2.17.39.214|:80... connected. HTTP request sent, awaiting response... 200 OK Length: unspecified [text/html] Saving to: ‘index.html’ [ <=> ] 75,725 --.-K/s in 0.1s 2014-07-31 15:03:46 (690 KB/s) - ‘index.html’ saved [75725] -------------------------------------------------------------------------------- It seems reasonable to me to follow wget's example and don't give up after IPv6 connection fails but rather try the IPv4 instead. Version-Release number of selected component (if applicable): httpd-tools-2.2.15-31.el6_5
Fix committed upstream: http://svn.apache.org/r1626956
Follow up: http://svn.apache.org/r1628388
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://rhn.redhat.com/errata/RHSA-2015-1249.html