Thursday, November 24, 2011

My answer to "Which server is best for LampCMS???"

This is my answer to a Question on Support site for LampCMS project


This site runs on Lighttpd server. It's easy to install, easy to configure. Rewrite rules for it are documented in the program distribution. Using lighttpd with php-fpm (fastcgi process manager for php) is close to 10 times more efficient than traditional Apache with mod_php and most importantly running php under php-fpm adds an extra function to the php 'fastcgi_finish_request' which this program uses to implement a 'runLater' functionality.
It allows the web server to close connection to the browser but continue to execute some extra functions after. For example posting your new question to Twitter, Facebook, etc is done after the page is served to uses, so even if it takes an extra second or two, the user will not see that extra delay in page load. It's also used for indexing new post, finding similar topics, updating tags, updating the geo-location of the request for the 'whos online' plugin.

So no matter which server you choose (even Apache can do that), you should always try to set up the php-fpm and run your php as fastcgi under the php-fpm control. The result will be very similar to using an extra thread in Java to do heavy processing without affecting the load time of the page.

No comments:

Post a Comment