Hi,

I have been working on converting slapd from using NSPR PR_Poll to using epoll(7), forked from release 1.4.4.

The fork can be found here https://github.com/lslile/389-ds-base/tree/epoll.  The patch is also attached.

I would appreciate any feedback from the community on my progress so far and any assistance with bringing this change to completion.  I also hope that it might well be integrated with James Chapman's Connection Table splitting proposal and further proposal regarding listener threading.

I believe my code still contains an error, causing it to occasionally lose track of a connection under heavy load, but I have so far been unable to find the error.  It doesn't seem to happen when I have  logging at SLAPI_LOG_CONNS, so it is possible I have caused or encountered a race condition.

I tried not to deviate too far from the existing code at this point, the major changes at this point are:

Is epoll(7) available on all platforms supported by 389-ds?  Because I don't know, I have hesitated to remove any NSPR related code at this point.


In my testing I have found that epoll is provides a measurable boost in client servicing, however my current testing methodology is not sufficiently regimented enough to provide statistically sound measurements.



I believe conversion from PR_Poll to epoll(7) fits well with the "389 ds connection management proposal" that James Chapman had raised.

When epoll is accepting a large number of concurrent connections there are obvious stalls that indicate the need for one or more listener threads to be created to separate client connection processing from connected client servicing.

I also think that James' idea of creating multiple Connection Tables could be simplified with epoll.

  • Connection_Table->epollfd could be converted to an array of epoll fd sets
    • one thread and epoll fd for each listener
    • one thread and epoll fd for each "Connection Table" processors
  • Re-balancing connections between "Connection Table" processors could then be accomplished by adding and deleting the fd in the appropriate "Connection Table" epoll fd sets

Thanks in advance for all input or assistance.

--Larry