On Thu, 2007-10-25 at 10:59 +0200, Petter Reinholdtsen wrote:
> In a simple test to see how libnss-ldapd handled several lookups at
> once (trying to figure out how many connections I would get to the
> LDAP server, I ran several of these commands:
> 
>   (ls -lL /home/&); ls -l /proc/$(cat /var/run/nslcd/nslcd.pid)/fd/

nslcd currently starts 5 threads in which each thread opens it's own
connection to the LDAP server. The communication between the NSS part
and nslcd part uses an I/O timeout value of of upto a couple of seconds
(both NSS part and nslcd have separate timeouts for reading and
writing). These values are currently hard-coded in the source. Any
improvements to the values or mechanism are appreciated.

> This resulted in the kernel killing nslcd because the machine ran out
> of memory.  I am testing on a xen client with 128 MiB RAM. The reason
> seem to be that nslcd is using a lot of memory while processing the
> request from this command.  The /home/ directory contain 305 users (or
> symlinks to users) home directories.
> 
> The nslcd process started at 47/2 MiB (VIRT/RES) and increases to
> 78/31 after one invocation of the command listed above.  Here is a
> table of how much is increases:
> 
>   Runs  VIRT  RES
>      0    47    2
>      1    78   31
>      2   110   65
>      3   140   95
>      4   (killed)
> 
> Is there anything more debug information I can provide?

There are a number of known memory leaks in the code. I'm working on a
better memory management model for the LDAP results (you have to be very
careful about free-ing memory you got from the LDAP library).

I have already identified and fixed a couple of leaks and I'm still
looking for new ones. I will probably make a new release soon that
contains these fixes.

-- 
-- arthur - [EMAIL PROTECTED] - http://people.debian.org/~adejong --

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to