Bug 178940 - nscd: no more memory for database
Summary: nscd: no more memory for database
Alias: None
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: glibc   
(Show other bugs)
Version: 4.0
Hardware: All
OS: Linux
Target Milestone: ---
: ---
Assignee: Jakub Jelinek
QA Contact: Brian Brock
Depends On:
TreeView+ depends on / blocked
Reported: 2006-01-25 17:00 UTC by Rex Dieter
Modified: 2007-11-30 22:07 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2006-03-15 19:39:38 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

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

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:

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)

Note You need to log in before you can comment on or make changes to this bug.