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.
 
Nice. I've uninstalled Xcache and installed Opcache. So far so good. Now I just need to figure out how to install Memcached.
 
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?
 
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/
 
No, I don't have memcached under etc/sysconfig/. I'll follow the directions at the link you provided. Thanks again.
 
yum install memcached will do it

here is my /etc/sysconfig/memcached file

Code:
PORT="11211"
USER="memcached"
MAXCONN="1024"
CACHESIZE="1024"
OPTIONS="-l 127.0.0.1"
 
Looks like memcached is working well:

Code:
root@bms [~]# memcached-tool 127.0.0.1 stats
#127.0.0.1:11211   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:

Code:
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:
No, they are in /etc/php.d/opcache.ini (or something similar, mine is 10-opcache.ini)
 
Back
Top Bottom