Bug 178940

Summary: nscd: no more memory for database
Product: Red Hat Enterprise Linux 4 Reporter: Rex Dieter <rdieter>
Component: glibcAssignee: Jakub Jelinek <jakub>
Status: CLOSED NOTABUG QA Contact: Brian Brock <bbrock>
Severity: medium Docs Contact:
Priority: medium    
Version: 4.0CC: nobody+bjmason
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2006-03-15 19:39:38 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Rex Dieter 2006-01-25 17:00:18 UTC
# rpm -q nscd
nscd-2.3.4-2.13

On a mailserver of ours, I'm seeing *lots* of
Jan 24 21:29:00 mail nscd: 22890 no more memory for database 'hosts'
in /var/log/messages over the past few days

May be related to google search hit on same/similar error:
http://sources.redhat.com/bugzilla/show_bug.cgi?id=1204

In the meantime, I've modified /etc/nscd.conf host section
-suggested-size          hosts           211
+suggested-size          hosts           419
and issued 
/sbin/service nscd restart
to see if that helps.

Eerie output of nscd -g (note the high "memory allocation failed" count):
...
hosts cache:
            yes  cache is enabled
            yes  cache is persistent
            yes  cache is shared
            211  suggested size
         216064  total data pool size
          12944  used data pool size
           3600  seconds time to live for positive entries
             20  seconds time to live for negative entries
           4087  cache hits on positive entries
           5837  cache hits on negative entries
         202366  cache misses on positive entries
          99294  cache misses on negative entries
              3% cache hit rate
             94  current number of cached values
           1568  maximum number of cached values
             20  maximum chain length searched
              0  number of delays on rdlock
              0  number of delays on wrlock
          51264  memory allocations failed
            yes  check /etc/hosts for changes

Comment 1 Rex Dieter 2006-01-25 17:05:17 UTC
During periods where this error occurs, some samba shares exported from this 
same box become unresponsive/slow with (some?) windows clients 
receiving "delayed write failed" errors related to (op)locked files.

Comment 2 Rex Dieter 2006-01-25 17:10:08 UTC
Hmm... my new 'suggested-size' didn't take until I cleared the db files 
in /var/db/nscd.

Perhaps these db files should be cleared when the service is stopped.

Comment 3 Rex Dieter 2006-01-26 14:42:00 UTC
Now, getting the same error for passwd too:

Jan 26 05:16:27 xxx nscd: 14200 no more memory for database 'passwd'
Jan 26 05:16:58 xxx nscd: 14200 no more memory for database 'passwd'
Jan 26 05:17:31 xxx nscd: 14200 no more memory for database 'passwd'


Comment 4 Jakub Jelinek 2006-03-15 19:39:38 UTC
If the database is persistent (as requested in the config file, RHEL4 default),
then it of course should not be cleared.
You need to
/usr/sbin/nscd -i hosts -i passwd -i group
it manually.

Comment 5 Rex Dieter 2006-03-16 16:34:13 UTC
Are you suggesting that the /var/log/messages errors:
Jan 24 21:29:00 mail nscd: 22890 no more memory for database 'hosts'
and nscd -g output saying:
51264  memory allocations failed
are by design and NOTABUG?  (I seriously hope not)