On Thursday 07 April 2016, Carlos E. R. wrote:
> On Thursday, 2016-04-07 at 10:13 +0100, Ruediger Meier wrote:
> > Hm, my interpretation was wrong. To get meaningful stats you need
> > to set shared   xyz    no
>
> Let's try:
>
> AmonLanc:~ # grep shared /etc/nscd.conf
> #       shared                  <service> <yes|no>
>          shared                  passwd          no
>          shared                  group           no
>          shared                  hosts           yes
>          shared                  services        yes
>          shared                  netgroup        yes
> AmonLanc:~ #
>
> > It can only count stats if accesssed via socket but not if other
> > processes are reading directly in nscd's memory.
> >
> > I really wondered about the low hit rates because any process who
> > needs to convert uids into user names (like ls -l) should use
> > nscd's passwd table rather than parsing /etc/passwd again and again
> > or even worse asking the ldap or NIS server. This is IMO the most
> > notable speedup. host caching is less useful.
>
> Surely ls -l only needs to do this just once per different uid, not
> once per file?

Only once per command and uid can be really much. Imagine running 
multiple shell scripts (containing many commands). Moreover multiple 
machines. They all would use one central LDAP server without local 
caching. 

> > This is what I have after 10 minutes now
> > $ nscd -g | grep "hit\|cache:"
>
> After doing two "ls -l":
>
> AmonLanc:~ # nscd -g | grep "hit\|cache:"
> passwd cache:
>                2  cache hits on positive entries
>                0  cache hits on negative entries
>                0% cache hit rate
> group cache:
>                3  cache hits on positive entries
>                0  cache hits on negative entries
>                0% cache hit rate
> hosts cache:
>                0  cache hits on positive entries
>                0  cache hits on negative entries
>                0% cache hit rate
> services cache:
>                0  cache hits on positive entries
>                0  cache hits on negative entries
>                0% cache hit rate
> netgroup cache:
>                0  cache hits on positive entries
>                0  cache hits on negative entries
>                0% cache hit rate
> AmonLanc:~ #
>
>
>
> What happens if shared=yes, does it still work, but report fais to
> say so?

Yes I assume that shared=yes works. Should be faster than shared=no. 
Just stats are not possible by design.

> What other effects has shared=no?

con:
 - a bit (or much?) slower
pro:
 + nice statistics
 + maybe less possible bugs and security problems (not sharing memory
   between different user's processes avoids a lot possible problems)

cu,
Rudi
_______________________________________________
Evergreen mailing list
Evergreen@lists.rosenauer.org
http://lists.rosenauer.org/mailman/listinfo/evergreen

Reply via email to