How to speed up website performance using caching solution XCache?

If you are looking for caching solution to speed up the website performance, XCache is one of the best solutions.
 

What is XCache and use of it:

  1. XCache accelerates the performance of PHP on servers. It speed up the page loading.
  2. XCache optimizes performance by eliminating the compilation time of php scripts by caching the compiled state of php scripts in to the RAM and uses the compiled version straight from the RAM.
  3. This will increase the rate of page generation time upto 5 times as it also optimizes many other aspects of php scripts and reduce server load.

How to enable XCACHE via SSH:

  1. Download the XCACHE
  2. For linux VPS, you can login to your server via SSH and execute following commands for XCACHE installation:
    • # wget xcache.lighttpd.net/pub/Releases/3.1.0/xcache-3.1.0.tar.gz [this line will download the XCACHE]
    • # tar -zxvf xcache-3.1.0.tar.gz [this line will extract the file]
    • # cd xcache-3.1.0
    • # phpize
    • # ./configure –enable-xcache
    • # make
    • # make install
  3. Now, add the following extension in php.ini file:
    • extension=xcache.so
  4. Restart Apache

How to enable XCACHE from WHM/cPanel:

  1. Login to your WHM
  2. Go to EasyApache from left hand pane options
  3. Keep Previously Saved Config option selected and click on Start customizing based on profile
  4. Do not need to change anything in Apache and PHP. Simply click on Next button to goto next steps
  5. From Short Option List, you will have an option xcache for php. Select this option and click on Save and Build
  6. It will take few minutes to complete the Build process. Once done restart Apache from WHM
  7. You can modify the values set for Xcache from php.ini file

Following are the recommended settings for Xcache, however, you can modify them as per your requirements:

XCache Administration Settings:

xcache.admin.user="mOo"
xcache.admin.pass=""
xcache.admin.enable_auth="on"
xcache.test="Off"
xcache.coredump_directory=""
xcache.disable_on_crash="off"

XCache Cacher Settings:

xcache.cacher="On"
xcache.stat=”On”
xcache.shm_scheme="mmap"
xcache.readonly_protection=Off
xcache.size="50M"
xcache.count="1"
xcache.slots="8K"
xcache.ttl="3600"
xcache.gc_interval="300"
xcache.var_size="16M"
xcache.var_count="2"
xcache.var_slots="8K"
xcache.var_ttl="3600"
xcache.var_maxttl="7200"
xcache.var_gc_interval="300"
xcache.mmap_path="/dev/zero"
xcache.readonly_protection="Off"

XCache Optimizer Settings:

xcache.optimizer="On"

XCache Coverager Settings:

xcache.coverager="Off"
xcache.coverager_autostart=”Off”
xcache.coveragedump_directory="/tmp/pcov/"
 
You can verify installed Xcache and its settings by uploading simple phpinfo() page.
  • 1 Users Found This Useful

Was this answer helpful?

Related Articles

How to Generate a Certificate Signing Request (CSR) with OpenSSL?

OpenSSL is a common utility used to generate a pair of private key and public Certificate Signing...

How to Upgrade Apache using EasyApache?

In this article we'll discuss how to upgrade Apache using EasyApache tool in WHM. EasyApache is a...

How to restart Apache to make httpd.conf changes permanent?

When cPanel is updated or Httpd service is restarted using WHM, the custom changes made in the...

Locations of Common Log Files and Configuration Files for cPanel Services

This article covers the configuration file and log file locations of most common cPanel services....

How to Enable/Disable Apache/PHP Modules Using EasyApache3?

In this article we'll discuss how to enable/disable Apache or PHP modules using the EasyApache...