public inbox for
 help / color / mirror / Atom feed
* network information caching
@ 2011-10-31  6:01 Ulrich Drepper
  0 siblings, 0 replies; only message in thread
From: Ulrich Drepper @ 2011-10-31  6:01 UTC (permalink / raw)
  To: libc-hacker

getaddrinfo was forever quite inefficient since it often had to had to
read network information to determine the sorting.  In a normal
process this information cannot be cached since it can change at any
time and there is no change counter.

nscd can track changes, though.  netlink provides a way for a
userlevel process to be notified about network configuration changes.
This is now used in git head.  In addition to optimizing the
getaddrinfo calls in nscd itself (i.e., the previous results are
reused if the network configuraiton hasn't changed), the information
is also exported to other processes using nscd's shared memory.

You now might see that many/most getaddrinfo calls won't need a single
system call.

The only minimal drawback is that the nscd cache and shared memory
layout changed.  nscd can transparently handle this.  It's just that
the cache content gets lost if a new nscd is launched.  That's all.

The code is lightly tested.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-10-31  6:01 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-10-31  6:01 network information caching Ulrich Drepper

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).