Red Hat Bugzilla – Bug 1270950
getaddrinfo() takes long time when lots of IP addresses are configured
Last modified: 2017-03-21 06:35:04 EDT
Description of problem: This is a bug that reported into glibc in 2011. It has been fixed in glibc, but this commit ha not made it into the CentOS release of glibc as of glibc-2.12-1.166.el6_7.3.x86_64. Here is a link to the original BZ for glibc: https://sourceware.org/bugzilla/show_bug.cgi?id=12907 [^] We are now configuring over 10k IPs on the same server, and this has been killing us. As a temporary fix, I patched glibc-2.12-1.166.el6_7.3.x86_64 with Ulrich's patch and have been running it in our production environment. Here is the specific glibc commit info: commit fa3fc0fe5f452d0aa7e435d8f32e992958683819 Author: Ulrich Drepper <drepper@gmail.com> Date: Wed Jun 22 15:00:54 2011 -0400 Avoid __check_pf calls in getaddrinfo unless really needed Can we please get this added into the next release of glibc? Version-Release number of selected component (if applicable): glibc-2.12-1.166.el6_7.3.x86_64 How reproducible: From the original glibc BZ report: - configure lots of addresses #!/usr/bin/perl my $addrCount = 64000; for (my $i=1; $i < $addrCount; $i++) { my $w1 = ($i % 254) + 1; my $w2 = ($i / 254) + 1; my $s = sprintf("ip addr add 10.5.%d.%d dev eth0", $w2, $w1); print "$s\n"; system ($s) } - resolve a literal address struct addrinfo ai; struct addrinfo *ailist = NULL; memset(&ai, 0, sizeof(ai)); ai.ai_family = af; ai.ai_flags = AI_PASSIVE; getaddrinfo("10.5.1.1", "0", &ai, &ailist); freeaddrinfo(ailist); Actual results: Takes a very long time to spin through the inventory of IP addresses. Expected results: Additional info:
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-2017-0680.html