my experience with cache (file, xcache, apc)

Can anyone tell why Opcache stops getting hits when I enable Xcache on my server?
Opcache + Memcache both get hits.
Opcache + Xcache only the latter gets hits.
 
Because OPcache and XCache serve the same purpose (an opcode cacher), there would be no point to spin it through 2 opcode cachers (at least as far as the "hits on the opcode side go).

It would be similar to running 2 web servers on the same server and wondering why only each request is going through one web server.
 
Memcached in a single-server environment is most certainly better than NO cache, but using something like XCache to cache keys would be a little better (no overhead of a network connection, which memcached uses).

Are you talking about latency? With memcached on the same server as everything else there is no overhead, am I wrong? I thought it would only be an issue if memcached was on a separate server with poor latency.
 
As expected, memcached port shows no network activity.

mUqk5lP.png
 
Are you talking about latency? With memcached on the same server as everything else there is no overhead, am I wrong? I thought it would only be an issue if memcached was on a separate server with poor latency.
Yep... it's not going to be a huge amount of latency since it's local, but there is the overhead of having a network connection. It's really not a huge deal... just was saying that memcached is really designed for use with multiple servers is all.
 
Memcached in a single-server environment is most certainly better than NO cache, but using something like XCache to cache keys would be a little better (no overhead of a network connection, which memcached uses).
If you use one server, you certainly do NOT have a network overhead if you use a socket.
Code:
'backendOptions' => array(
    'servers' => array(
        array(
            'host' => 'unix:///var/run/memcached/memcached.sock',
            'port' => 0,
            'weight' => 1
        )
    ),
    'compression' => false
)
I personally use network everywhere, the overhead infinitesimal and not even worth mentioning. Not to mention that with Memcached you will have NO fragmentation when caching the sessions. The only way to go is OPCache + Memcached. Case closed.
 
After some time when buffers finally filled up I think I am noticing improvement in speed.
 
I have disabled memcached on my VPS. After some tests on Xenforo and Wordpress (with cache plugins) both sites are actually faster when it is not used. Now I have NGINX for static content, MariaDB, Zend Opcache and it is satisfyingly fast :)
 
I've been running the built-in PHP OPCache + Memcached for awhile now, works great.
 
Last edited:
Top Bottom