On 16 Jun 2011, at 10:27 AM, Stefan Fritsch wrote:

I mostly agree with Graham. I propose a hybrid approach. Make the MPM and the network/connection filters (this includes ssl) event driven and keep the request handling based on threads and workers.

We used openssl to make our non blocking event driven stuff work, and it works really well (once you've properly handled SSL_ERROR_WANT_READ and SSL_ERROR_WANT_WRITE). There is no reason I can see that would stop us using openssl to be async in httpd, we just need to refactor the mod_ssl code to actually do it.

The tricky part with event driven code is the really bad support for event driven file access. We used libev as our core event loop, which does a significant amount of work to make files and sockets work the same way in the event loop as best it can in a portable way. Don't know of any other event loop that does this. It's difficult trying to do the event driven thing if you intersperse event driven socket handling with blocking file handling, you end up with many requests blocked by an unrelated system call.

One needs to keep a clear separation between "we're event driven and non blocking" code and "we're now in worker mode, and are allowed to block" code.

Regards,
Graham
--

Reply via email to