Adventures in HttpContext All the stuff after 'Hello, World'

How eAccelerator Improved WordPress on My Fedora Server

I recently moved this blog and some other smaller websites to a virtual machine running on Rackspace Cloud. So far I’m loving having my own server, and have been able to get my hands dirty with Linux administration, apache, and mysql.

But one quirk was really bothering me: at times, my WordPress blog would hang. I don’t get too much traffic, and using

top

showed no real load on the cpu. But there were a lot of Apache threads with a good chunk of memory allocated, and I had a little free memory available.  I tried adding more memory to the server, but no luck.  I thought the issue could be mysql, but running queries wasn’t a problem.  Neither was static html- the root index.html loaded quickly.  So that left php itself.

A couple of apache config changes didn’t help.  The thing which really did the trick was installing eAccelerator.  This tool simply keeps the compiled php script available, so apache doesn’t have to recompile the php script on every load.  No, the blog is a lot faster and much more reliable.

Installation is easy on Fedora (or CentOS, or whatever distro uses yum):

sudo yum install php-accelerator

then just restart apache and you’re good to go:

sudo /sbin/service httpd reload

If you don’t notice an immediate improvement, and want to check to make sure it’s loaded, then create a info.php file with the following code:

<?php phpinfo(); ?>

and you should see the accelerator info in the list.