Bug 1204 - nscd cannot extend memory heap sizes
Summary: nscd cannot extend memory heap sizes
Status: RESOLVED FIXED
Alias: None
Product: glibc
Classification: Unclassified
Component: nscd (show other bugs)
Version: 2.3.5
: P2 normal
Target Milestone: ---
Assignee: Ulrich Drepper
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-08-17 21:24 UTC by Nick Burrett
Modified: 2019-04-10 09:58 UTC (History)
1 user (show)

See Also:
Host: i686-pc-linux-gnu
Target: i686-pc-linux-gnu
Build: i686-pc-linux-gnu
Last reconfirmed:
fweimer: security-


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Burrett 2005-08-17 21:24:10 UTC
The change in nscd to use mmap for memory allocation of caches presents a
problem in that once the cache is full, mempool_alloc cannot extend the size of
the cache because 'mremap' will always fail.

   4279: no more memory for database 'group'

$ nscd -g shows:
         216064  total data pool size
         214664  used data pool size
              7  memory allocations failed

The problem is that for a system with large group memberships (i.e. several
thousand users), which are held in LDAP databases, as pool sizes cannot
increase, the result is poor performance, with commands such as a simple 'ls'
taking 10-20 seconds to complete.  The group lookup cannot be cached because
there is no further space to hold the data.

Certainly it is possible to work around this problem by increasing
'suggested-size' from say 211 to 10007, but clearly the 'mremap' is going to
fail in any case.

Can we not use malloc and realloc instead ?
Comment 1 Ulrich Drepper 2005-08-24 01:16:59 UTC
> Can we not use malloc and realloc instead ?

You don't understand the code *at all*.  Using malloc et al is of course
completely out of question since it would neither allow persistence nor sharing.

There was a problem with the mremap handling.  This is fixed in the current code.
Comment 2 Thomas Brown 2006-05-03 05:57:23 UTC
Note that this bug still appears to exist 8 months later in RHEL 4.2 with 'nscd'
2.3.4.