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

Slapd out of fd's -> accept() fails -> server busyloops (ITS#2482)



Full_Name: Matti Aarnio
Version: 2.2HEAD (CVS) 10-Mar-2003
OS: Solaris 8
URL: ftp://ftp.openldap.org/incoming/
Submission from: (NULL) (62.240.94.133)


Probably a thing also in 2.1 series.

In Solaris 8 (very least) when process runs out of openable files (ulimit -n),
accept(2) returns:  EMFILE  error, and leaves the nascent socket in queue.

The end result is, that the system is busily looping at the main
poll()/select(),
and unable to recover in itself.  When enough clients close to make free fd:s,
then server recovers in itself, but in bad luck case, the saturation trouble
lasts for quite a while.  The clients will do timeouts, but those take (by
default)
quite a while...

A better approach would be:
  -  Know how many files the server process can open, possibly do maximize
     the number of processes at the start so that sysadmin does not need to
     try to remember to do that.
  -  If a socket fd number approaches that limit (with 10 or so..), accept()ed
     socket shall be close()d immediately.

Possible codes to query current "nfiles",  and to adjust it (maximize):

http://www.zmailer.org/cgi-bin/cvsweb.cgi/~checkout~/zmailer/scheduler/resources.c?rev=1.3&content-type=text/plain

Apparently that has some "AIX snafu", if you ever fix that, do tell me.