Friday, November 19, 2010

Its awesomeness, Apache HTTPD2

I've been working a lot in the last few days. I've added a GeoIP wrapper for Concept, documentation available at http://www.radgs.com/docs/help/GeoIP.html. Nice library by the way.

Now, for the cool stuff. I was thinking how much content is served to all the visitors ... and that content is cached by memcached to reduce workload ... but I think I can go further - direct caching from the web server. Let's see in the pretty colored schema bellow.


Let's say that an user (Client1) makes a request to Apache HTTPD. The server will call ConceptCGI to process the request, and the script will access a memcached server for caching data. But, if we cache the whole page, images, etc., why is a need for the CGI to run? Well, it isn't. For that I write an Apache module (mod_conceptcache) that allows the server to serve cached memcached data very fast, so fast that Client 2 will access cached data very fast without generating any significant CPU or memory usage on the server - and that's critical because the server can serve more users using the same resources. I've set some nice APIs for the back-end, the programmer being able to explicitly cache data for visitors, users or locations (as you can see in the figure, mod_concept_cache is linked to GeoIP). Documentation is available on http://www.radgs.com/docs/help/ApacheCacher.html.
GyroGears is already aware of this, and generates code for the http back-end using ApacheCacher.

PS: Fast = tens of times faster

No comments: