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

Re: >1024 connections in slapd / select->poll



Kurt D. Zeilenga wrote:

Hmmm. I just wrote a small test client which opens a large number of connections to the LDAP server and then closes them again. (It issues an anonymous search as well.) I encountered a server hang at around 2050 connections, stuck in the WAKE_LISTENER macro. Apparently when a large number of connections closes in rapid succession like this the pipe that's used for waking the listener gets full.

I note that our definition of WAKE_LISTENER has an #if case for NO_THREADS / GNU_PTH in which case it doesn't write anything into the pipe if a flag "waking" is already set. When I use this version on the pthreads build, the hang at 2050 closes disappears. It seems we need this waking test by default.



Watch out, IIRC, there is a race condition in there (which we avoided by sending multiple wakes).

OK. I couldn't find the specifics of the race conditions in the CVS log, but we can still handle this if "waking" is a small-valued counter. I don't think the specific limit matters as long as it's under ~2000.

--
 -- Howard Chu
 Chief Architect, Symas Corp.       Director, Highland Sun
 http://www.symas.com               http://highlandsun.com/hyc
 Symas: Premier OpenSource Development and Support