PHP is been pretty slow for me since I left Apache 2 and the PHP code caching behind. I tried turck mmcache with PHP4 and it worked pretty badly. It sped things up, but lighttpd started freezing up every few hours. It was probably FastCGI screwing up and it might have been fixed with FastCGI since then. But I'm all PHP5 now, so I needed to use something else. The Lighttpd guys suggested (and maybe created) XCache so I tried it. It only took a few minutes to install and it's working sweet. WordPress page loads are down from 300ms to 50ms. I just hope it doesn't screw other things up.
I used the XCache installation instructions but had to do things a bit differently.
Downloaded the XCache source from http://xcache.lighttpd.net/
~/src $ wget http://... (the release url) ~/src $ tar -zxf xcache-*.tar.gz ~/src $ cd xcache
You have to install
php5-dev
andmake
if you haven't got them~/src $ sudo apt-get install php5-dev make
Run the PHP/XCache installation stuff
~/src/xcache $ phpize ~/src/xcache $ ./configure --enable-xcache ~/src/xcache $ make ~/src/xcache $ sudo make install
Edit the php.ini file to tell it where the
xcache.so
file is located. Mine was at/usr/lib/php5/20051025/xcache.so
. You need to edit thexcache.size
setting (I used 32M, but others use 64M) and theextension
(orzend_extension
) setting.~/src/xcache $ find /usr -name xcache.so ~/src/xcache $ sudo vi /etc/php5/php.ini
Check that it's working
~/src/xcache $ php-cgi -v
Restart lighttpd
~/src/xcache $ sudo /etc/init.d/lighttpd restart
Comments
No comments yet.
Leave a comment