getaddrinfo() optimization

Alexander Komyagin komyagin at altell.ru
Wed Apr 4 09:21:37 UTC 2012


On Tue, 2012-04-03 at 17:10 +0200, Bernhard Reutner-Fischer wrote:
> On 3 April 2012 16:48, Alexander Komyagin <komyagin at altell.ru> wrote:
> > Hello!
> >
> > 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().
> 
> yes, good catch.
> >
> > Small simple patch to fix this issue is attached.
> 
> You forgot the Signed-Off-By line. See http://uclibc.org/developing#contrib
> Please resend (with c89 quotes).
> TIA!
> >
> >
> > --
> > Best wishes,
> > Alexander Komyagin
> >
> > _______________________________________________
> > uClibc mailing list
> > uClibc at uclibc.org
> > http://lists.busybox.net/mailman/listinfo/uclibc

Done.

-- 
Best wishes,
Alexander Komyagin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-getaddrinfo-avoid-call-to-__check_pf-when-not-needed.patch
Type: text/x-patch
Size: 1378 bytes
Desc: not available
URL: <http://lists.busybox.net/pipermail/uclibc/attachments/20120404/da7167d9/attachment.bin>


More information about the uClibc mailing list