• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Change Xcache to (Opcache and (APCU or Memcached)) for PHP 5.4?

Amin Sabet

Well-known member
I'm on PHP 5.4 and not planning to change to PHP 5.5 any time soon because I have both vB and XF sites, and vB seems to have some issues with PHP 5.5. I'm on a single, dedicated server running Litespeed webserver with Litespeed cache.

I'm currently using Xcache but was thinking of uninstalling that and installing Opcache + either APCU or Memcached. Would this change make a noticeable difference to site performance? Appreciate any insights from those who have tried this.

Amin Sabet

Well-known member
Nice. I've uninstalled Xcache and installed Opcache. So far so good. Now I just need to figure out how to install Memcached.

Amin Sabet

Well-known member
Thanks for that! Is memcached a better option than APCU?

Also, I noticed that the linked instructions refer to installing php-pecl-memcache. I already checked the option to install memcache via easyapache when I compiled Apache/PHP. Is it okay to follow these instructions which seem to re-install that while installing memcached?


Well-known member
From my experience, memcached. No benchmarks though.
You've installed the PHP extension but have you installed the library files? Check for memcached under /etc/sysconfig/


Well-known member
yum install memcached will do it

here is my /etc/sysconfig/memcached file


Amin Sabet

Well-known member
Looks like memcached is working well:

root@bms [~]# memcached-tool stats
#   Field       Value
         accepting_conns           1
               auth_cmds           0
             auth_errors           0
                   bytes      962130
              bytes_read     9333793
           bytes_written  1321219651
              cas_badval           0
                cas_hits           0
              cas_misses           0
               cmd_flush           0
                 cmd_get      444056
                 cmd_set         926
             conn_yields           0
   connection_structures          23
        curr_connections          16
              curr_items         251
               decr_hits           0
             decr_misses           0
             delete_hits           4
           delete_misses           0
               evictions           0
                get_hits      443457
              get_misses         599
               incr_hits           0
             incr_misses           0
          limit_maxbytes  1073741824
     listen_disabled_num           0
                     pid       32419
            pointer_size          64
           rusage_system    3.075532
             rusage_user    0.794879
                 threads           4
                    time  1423358842
       total_connections         110
             total_items         926
                  uptime        7845
                 version       1.4.4

And from PHP Info looks like Opcache also working:

Zend OPcache
Opcode Caching Up and Running
Optimization Enabled
Startup OK
Shared memory model mmap
Cache hits 144779
Cache misses 1233
Used memory 123809552
Free memory 10408176
Wasted memory 0
Interned Strings Used memory 5671928
Interned Strings Free memory 2716680
Cached scripts 1229
Cached keys 1392
Max keys 7963
OOM restarts 0
Hash keys restarts 0
Manual restarts 0

Thanks again, everyone, for the help!
Last edited: