[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: too many open files



Hello,

> > Hello,
> > 
> > don't want to discourage you, but my slapd (2.4.11 on Debian Lenny)
> > still has problems with more than 1024 files.
> > 
> > I have
> > -- ulimit -n 4096 in /etc/default/slapd
> > -- checked the output of /proc/`pidof slapd`/limits
> > -- downloaded the source package from Debian (version 2.4.11),
> >    did a grep for FD_SETSIZE and found that it is set to 4096
> > -- built a new package from these sources with configure options:
> >    --disable-tcpwrapper
> > 
> > In a loop from a python script, I then connect, bind, search the ldap
> > server and keep all the connections open, like so:
> > 
> > ...
> > def ldap_connection_func():
> >   global n
> >   l = ldap.initialize("ldaps://ldap...")
> >   l.simple_bind_s(username, password)
> >   l.search_s('dc=haiti,...', ldap.SCOPE_SUBTREE, 'objectclass=*')
> >   n.append(l)
> > 
> > for x in range(0,1100):
> >   ldap_connection_func()
> > ...
> 
> 
> What was the ulimit -n in the shell from which you ran this python script? If 
> you are using a single process to generate the load to the server, this 
> process obviously also needs to be able to open sufficient files.

Ah, I see.
I just have adjusted the ulimit size on the server side (to 4096). I
never thought about the client's side, where I started the script. Here,
the "ulimit -n" is 1024. Indeed, if the client tries to open less than
1024 files, everything is fine. Even if I start the script 3 times (each
in a separate shell) everything runs as expected. The clients and the
server do not have a problem, in detail, the server opened more than
1024 files at the same time successfully.

> > I see the number of open files of the slapd process rise to about 1080,
> > then all connections opened from the script are closed while slapd keeps
> > running.
> 
> It is funny that slapd opened more than 1024 files then, as it should either 
> have stopped at less than 1024 fd's (as it has other files open), or the script 
> should have reached 1100 connections, or your script is running with a file 
> descriptor limit.
> 
> > We now will try to set the idletimeout parameter to some sensible value
> 
> It looks like your slapd file descriptor limit is now taking effect, you just 
> need to test better, and/or interpret the results better ....

Yes, you are right.
I should set ulimit in the /etc/default/slapd and it will work.

> Regards,
> Buchan

Regards,
Klemens

-- 
Klemens Kittan
Systemadministrator

Uni-Potsdam, Inst. f. Informatik
August-Bebel-Str. 89
14482 Potsdam

Tel.    : +49-331-9773125
Fax.    : +49-331-9773122
eMail   : kittan@cs.uni-potsdam.de

gpg --recv-keys --keyserver wwwkeys.de.pgp.net 6EA09333

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