linux poison RSS
linux poison Email

How to use/configure nscd for caching

nscd (Name Service Cache Daemon) is a GNU C Library -- A daemon which handles passwd, group and host lookups for running programs and caches the results for the next query. You should install this package only if you use slow Services like LDAP, NIS or NIS+

The nscd service comes as part of glibc , which means every Linux distribution will provide it. It is also extremely simple to set up. Once installed, edit the /etc/nscd.conf file to look similar to this:

 server-user nscd
  debug-level 0
  reload-count unlimited
  paranoia no
  enable-cache passwd yes 
  positive-time-to-live passwd 3600 
  negative-time-to-live passwd 20 
  suggested-size passwd 211 
  check-files passwd yes 
  persistent passwd yes 
  shared passwd yes 
  
  enable-cache group yes 
  positive-time-to-live group 3600 
  negative-time-to-live group 60 
  suggested-size group 211 
  check-files group yes 
  persistent group yes 
  shared group yes 
  
  enable-cache hosts no 

Now start the nscd service. The above configuration tells nscd to cache group and passwd entries and to let them persist for 3600 seconds.

Once nscd has started and has a few cached entries under its belt -- if you are already logged in and then disconnect from the network -- you will still be able to continue using the system just as if you were on the network -- apart from accessing shares and printers, utilising Kerberos, and performing new login sessions.


0 comments:

Post a Comment

Related Posts with Thumbnails