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

(ITS#3665) Multi-Listener Thread Support



Full_Name: Sang-Seok Lim
Version: HEAD
OS: SLES9
URL: ftp://ftp.openldap.org/incoming/multi_listener.diff
Submission from: (NULL) (68.198.8.176)


In order to make slapd more responsive and resilient, this patch enables the
multi-listener thread support in slapd.

The current slapd has a single listener thread and multiple operation threads.
The listener thread deals with 1) accepting incoming TCP connections and
initializing connection management data structures, 2) processing all incoming
LDAP requests, 3) waking up blocked operation threads. Moreover, most part of
the thread code is serialized. In this architecture, if the execution of the
listener thread gets stuck by the connection to an abnormal client, it will
stall the processing of other normal connections immediately. Alternatively, if
the listener thread is unable to grab CPU as soon as the blocked operation
thread becomes ready to wake up, the execution of the thread will be delayed,
increasing the response time.

So by introducing the multi-listener threads support which simply duplicates the
single listener as many as it is configured, we can not only achieve more
parallelism in the connection management of slapd but also make it responsive
and resilient to various exceptional behaviors of clients. In this multi
listener thread patch, each listener thread manages its own slapd_control which
has I/O event structures for epoll or select. The number of listener threads can
be configured in slapd.conf as follows,

numListener x

This patch has been tested for both epoll and select and passed all test
scripts. I am currently working on measuring performance and developing a load
balancing routine among listener threads.I appreciate any comments to the
patch.