getaddrinfo() optimization

Alexander Komyagin komyagin at
Tue Apr 3 14:48:42 UTC 2012


I found out that getaddrinfo() function in uclibc may cause performance
downgrades for some heavy-loaded services (e.g. squid) due to
unnecessary calls to __check_pf() (and hence getifaddrs() ). Really
these calls only needed when AI_ADDRCONFIG hint flag is given.

For example, squid uses getaddrinfo() to convert IP addresses from
textual to numeric form, providing just AI_NUMERICHOST hint flag. You
can imagine how many calls there are when you have about 1000 requests
per second and the overhead from netlink communications to kernel every
time in getifaddrs().

Small simple patch to fix this issue is attached.

Best wishes,
Alexander Komyagin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: recipes_uclibc_uclibc-git_fix_getaddrinfo_seen.patch
Type: text/x-patch
Size: 632 bytes
Desc: not available
URL: <>

More information about the uClibc mailing list