Having ploughed through writing my upcoming article for PHP Magazine on “Farming PHP” I am still motivated to think deeply about PHP in the enterprise and, specifically, under high volumes of web traffic. Having come through several industries in a variety of capacities where PHP is being used effectively for business-critical operations, I am used to responding to concerns about PHP in the enterprise. The one that I am planning to tackle in my next article is that, “PHP runs heavy.”
Dealing with this consideration really comes down to three points:
- Optimizing–both the source code and through encoders like apc, IonCube, and Zend Encoder
- Caching–using output buffering, Smarty, Cache_Lite and other techniques
- Staticizing–periodically outputting static assets to serve up using lightweight systems like thttpd
Armed with a solid benchmarking tool like ab, these three principles comprise a solid foundation for running PHP in the enterprise for very high volume sites. I look forward to fleshing these ideas out in the coming days and responding to your feedback about high performance PHP in the enterprise.


7 Comments
Instead of Smarty, you might want to take a look at Savant.
http://phpsavant.com/
Templates written in PHP means no need to compile; it has full OO support for plugins, filters, and even an optional compiler hook if you desperately want to limit your designers. Savant3 is even E_STRICT compatible for PHP5.
Have you had a look at http://www.danga.com/ for their Memcached and Perlbal programs?
just a quick comment: ab is not a solid benchmarking tool.
take a look at httperf for something a whole lot better.
I also second the memcached suggestion.
Cheers.
Thanks for all the suggestions!
Hi Jacques,
What is the status of your Cache_Memcached PEAR project? It would be great to finally have a definitive API for this in PHP…
Cheers,
Robert
I just finished writing my article for the next issue of PHP Magazine, and as promised, I go into greater detail about optimizing, staticizing, and caching PHP to deliver high performance in heavy traffic. In the section on optimizing source code, I cite
Hi Robert,
I’ve resubmitted the proposal to the PEAR site. I’m currently almost finished rewriting the Cache_Memcached code aswell as adding some basic documentation. I think it should be finished in the next week or two.