This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Speeding up nscd


On Wed, 26 Dec 2012, Petr Baudis wrote:

nscd has a bad reputation due to a fairly long history of bugs; this stems from ugly spaghetti code and very aggressive use of multi-threading coupled with some synchronization issues in sensitive areas like garbage collection. Add NSS modules running in environment not tested commonly (long-lived many-threaded applications) to the list and as a result you get a list of bugs that not many are willing to debug to the bone (especially if not paid for it).

I think that by now, pretty much all the common nscd bugs might be
ironed out, but its bad reputation lingers; I would expect it to be
the main reason why most distributions shied away from nscd. There is
also a "unscd" alternative that has its pros and cons.

Hi Petr, interesting insight I didn't know of, so I went ahead and found "unscd" at [1]. Here is a part of the initial comment:



nscd problems are not exactly unheard of. Over the years, there were quite a bit of bugs in it. This leads people to invent babysitters which restart crashed/hung nscd. This is ugly.

After looking at nscd source in glibc I arrived to the conclusion
that its design is contributing to this significantly. Even if nscd's
code is 100.00% perfect and bug-free, it can still suffer from bugs
in libraries it calls.

As designed, it's a multithreaded program which calls NSS libraries.
These libraries are not part of libc, they may be provided
by third-party projects (samba, ldap, you name it).

Thus nscd cannot be sure that libraries it calls do not have memory
or file descriptor leaks and other bugs.

Since nscd is multithreaded program with single shared cache,
any resource leak in any NSS library has cumulative effect.
Even if a NSS library leaks a file descriptor 0.01% of the time,
this will make nscd crash or hang after some time.

Of course bugs in NSS .so modules should be fixed, but meanwhile
I do want nscd which does not crash or lock up.


Dimitris



[1] https://github.com/keymon/unscd/blob/master/nscd-0.47.c



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]