Event MPM Updates and mod_dialup

I know, I know, I haven’t written a blog post in months.

Forgive me :-)

Anyways, figured some people might be interested in what I commited last night for the Apache HTTP Server….

First is the ability to ‘suspend’ an HTTP Request from a Module.

Normally in Apache, there is a one to one relationship between the running thread, and a client connection that it is servicing.  In the Event MPM previously, we had broken it out so between different HTTP requests in the same TCP connection, aka Keep Alives, could be serviced by different threads.

Now with r697357 in httpd trunk, you can return SUSPENDED from a content handler.  The core  will assume you have taken over handling of the request, and get out of your way.

This is insanely important, because in the long run it lets you write very cool modules, like a full async HTTP Proxy, aka something like Varnish, where you could easily handle tens of thousands of client connections, using only a hundred odd threads, where today you would need a huge amount of RAM, and a single thread or process for every client to do this with Apache.

Secondly, as a demonstration that it works, I wrote mod_dialup. It is a module that sends static content at a bandwidth rate limit, defined by the various old modem standards. So, you can browse your site with a 56k V.92 modem, by adding something like this:

<Location /mysite>

ModemStandard V.92

</Location>

Previously to do bandwidth rate limiting modules would have to block an entire thread, for each client, and insert sleeps to slow the bandwidth down.  Using the new suspend feature, a handler can get callback N milliseconds in the future, and it will be invoked by the Event MPM on a different thread, once the timer hits.  From there the handler can continue to send data to the client.

This entry was posted in Uncategorized. Bookmark the permalink.

3 Responses to Event MPM Updates and mod_dialup

  1. Wow, this is great news!
    I hope we will see such asynchrony event processing in Apache in the near future, one server to rule them all :)

  2. Striker says:

    Furst poast!

  3. Jesus Altuve says:

    Great news Paul! I wonder if you have plans to create mod_mp4x I have sucesfully used mod_flvx on my site for almost 6 months with no problems ;) the only problem being me migrating to H264 :) and not having something to seek mp4 files in apache… (yes, I knowr about range requests, but my flash client is open source, and the author does not understand what a range request is)

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>