[Date Prev][Date Next]
[Chronological]
[Thread]
[Top]
How to raise the open file descriptor limit for slapd?
- To: openldap-software@OpenLDAP.org
- Subject: How to raise the open file descriptor limit for slapd?
- From: David Landgren <david@landgren.net>
- Date: Tue, 04 Oct 2005 11:47:52 +0200
- Organization: The Lusty Decadent Delights of Imperial Pompeii
- User-agent: Mozilla Thunderbird 1.0 (Windows/20041206)
List,
I have a fairly heavily used openldap-2.2.28 server in production and I
am running into the 1024 fd descriptor limit. From time to time I get
1024 beyond descriptor table limit 1024
on my syslog host. I found the following message in the archives:
http://www.openldap.org/lists/openldap-software/200303/msg00858.html
beyond descriptor table size error
One of the suggestions was to keep an eye on open sockets. So I wrote
the following script:
netstat --inet --numeric-hosts --numeric-ports --numeric-users \
| tail +3 \
| awk '{print $6}' \
| sort \
| uniq -c \
| awk '{n+=$1; print} END {printf("%7d\n", n)}'
which I run every five minutes. Within minutes of restarting slapd this
morning, I was seeing:
Tue Oct 4 09:09:02 CEST 2005
40 CLOSE_WAIT
242 ESTABLISHED
60 TIME_WAIT
342
Tue Oct 4 09:14:03 CEST 2005
37 CLOSE_WAIT
293 ESTABLISHED
65 TIME_WAIT
395
Tue Oct 4 09:19:03 CEST 2005
46 CLOSE_WAIT
335 ESTABLISHED
37 TIME_WAIT
418
Now during the heavy activity during the morning I see
Tue Oct 4 11:29:11 CEST 2005
131 CLOSE_WAIT
664 ESTABLISHED
2 FIN_WAIT1
1 FIN_WAIT2
32 TIME_WAIT
830
Tue Oct 4 11:34:12 CEST 2005
130 CLOSE_WAIT
647 ESTABLISHED
2 FIN_WAIT1
14 TIME_WAIT
793
Tue Oct 4 11:39:12 CEST 2005
131 CLOSE_WAIT
660 ESTABLISHED
2 FIN_WAIT1
1 FIN_WAIT2
40 TIME_WAIT
834
Tue Oct 4 11:44:13 CEST 2005
130 CLOSE_WAIT
659 ESTABLISHED
2 FIN_WAIT1
17 TIME_WAIT
808
So the close_wait values are getting higher, and I may be able to tune
this down by clamping the idle_timeout setting, but as it is, I don't
think I have enough headroom.
One of the suggestions was to increase FD_SETSIZE, which seems to me to
be the right thing to do, but I'm not quite sure what the recommended
practice is. In the CHANGES file I see a mention of OPENLDAP_FD_SETSIZE
but a quick grep through the source does not turn up any other reference.
Do I define this as an environment variable, or should I define
CFLAGS=-DOPENLDAP_FD_SETSIZE=2048 , or something else?
Your suggestions are appreciated,
David
--
"It's overkill of course, but you can never have too much overkill."