nscd again (nis client cache)

Adam McDougall mcdouga9 at egr.msu.edu
Tue Jan 22 22:04:57 PST 2008

I wanted to say Thanks!!! for this example, because before this point
I was under the impression that nscd/cached was of no use for NIS clients,
only LDAP or maybe other directory systems that I don't use.  I tried
"cache compat" as below for passwd and group and it works!  Our NIS 
entries at work are big enough that without the cache, top takes 7+ seconds to
open, ssh login takes a few seconds, and samba logins were concerningly
slow.  I did not try samba connections, but the other methods are much 
faster now on the second run.  Wanted to post this for the archive too.

On Sat, Jan 19, 2008 at 02:17:11PM +0300, Michael Bushkov wrote:

  Hi Denis,
  Several things:
  1. You definitely can't use cache for *_compat sources. I mean lines like 
  "group_compat: cache nis" aren't supported.
  2. Cache should work ok with the configuration you've mentioned in your 
  first example, i.e.: "group: cache compat". Just checking - why do you 
  think that cache isn't working? The correct way to determine it is to 
  perform the same query twice. During the first pass (when query is not 
  cached), the request will be processed by NIS module and you'll have all 
  the NIS-related stuff in the logs. On the second pass the request should be 
  handled by scd module - and you shouldn't see any activity in NIS logs. It 
  would be great to see the debug log (with nscd log turned on) separately - 
  for the first and the second pass. It would help to find the error in nscd, 
  if there is one.
  With best regards,
  Michael Bushkov
  On Jan 17, 2008, at 9:55 PM, Denis Barov wrote:
>> Hello!
>> I found some strange behaviour of NIS/nscd when NIS in compat mode. In
>> /etc/nsswitch.conf I have:
>> netgroup:         cache compat
>> passwd:           cache compat
>> group:            cache compat

More information about the freebsd-stable mailing list