Sunday, August 4, 2013

Yum Install XCache - A Superb Production Alternative for PHP Opcode Caching

Wanna gain as much as 5X your current PHP applications performance? Install XCache now to your server. It is tested to run in production and very stable. With XCache, no crazy error messages that has nothing to do with your code - how can a native function be mssing (APC is making a mess, remove it immediately)!?????
PHP Fatal error:  Call to undefined function in_array()
Here's how to install it in RHEL/CentOS.

First, you need the Remi repo information added to Yum registry. Copy and paste the following to your server repo registry.

# vim /etc/yum.repos.d/remi.repo
Then paste the following,

[remi]
name=Les RPM de remi pour Enterprise Linux 6 - $basearch
#baseurl=http://rpms.famillecollet.com/enterprise/6/remi/$basearch/
mirrorlist=http://rpms.famillecollet.com/enterprise/6/remi/mirror
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi

[remi-test]
name=Les RPM de remi en test pour Enterprise Linux 6 - $basearch
#baseurl=http://rpms.famillecollet.com/enterprise/6/test/$basearch/
mirrorlist=http://rpms.famillecollet.com/enterprise/6/test/mirror
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi

[remi-debuginfo]
name=Les RPM de remi pour Enterprise Linux 6 - $basearch - debuginfo
baseurl=http://rpms.famillecollet.com/enterprise/6/debug-remi/$basearch/
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi

[remi-test-debuginfo]
name=Les RPM de remi en test pour Enterprise Linux 6 - $basearch - debuginfo
baseurl=http://rpms.famillecollet.com/enterprise/6/debug-test/$basearch/
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi

# yum install php-xcache

Then tweak the configuration to your desired setting in /etc/php.d/xcache.ini.
Finally, reload your webserver configuration for it to take effect.

For more info go to http://xcache.lighttpd.net/wiki/Introduction

I am currently using this technology for ExploreTalent.com and the speed gain (~300% faster) have been very satisfying. Not to mention the cache-hit ratio of ~97% which indicates that it is indeed wonderfully working as expected. No crashes and weird missing PHP functions that you can encounter using APC or the rest especially observable in a high-traffic environment and with many cached objects.
  • Related Links Widget for Blogspot

No comments: