2009-02-16

Improve PHP application performance using opcode cacher and optimizer

One of university underpowered server cought "hiccup problems" during students rush at local Learning Management System (leading PHP LMS platform) during the end of semester. Because there was no chance for quick hardware upgrade I've checked server tuning check list again. Many basic settings was optimized (caches, all additional modules turned off etc.), but there was still room for small improvements. The big problem was memory limit under high load.

I've installed XCache PHP opcode cacher (they say it's production ready), and set it to cache most of common used code in RAM. Results was better than I suspected, maybe because of that application is utilizing a lot of PHP code. Under heavy load memory usage dropped about 3 times, the same gain factor was for CPU usage. I've checked if everything works ok and left it working with XCache then.

The next bottlenecks were database and CPU usage for some operations. It's hard to get further performance improvements of that scale without tweaking application code.

No comments: