[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) (

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
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
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):


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