APCu vs Memcache?

apcu theoretically should be faster under more scenarios as a datastore, however...
https://xenforo.com/help/cache/
"We do not recommend writing sessions to the cache if you are using APC as your cache back-end."

"Note that some versions of APC may be susceptible to cache-slam issues, so if you do enable APC caching of data (in addition to the PHP opcode cache that it maintains automatically without requiring any configuration), you should monitor your server carefully for a time to ensure that it is running smoothly."

What that actually means, I don't know
 
Because with APC, when you write sessions into it there are login issues.
Most likely login issues on admin panel.
 
I'm not the kind of person that can answer your question :D
All I can say is APC is only good for PHP 5.4 and lower versions.
Not for PHP 5.5 and up.
 
Apcu is faster yet more unreliable. From my understanding apc stores data as-is. Whereas all other caching solutions first modify data before storing it.
 
If you are only running a single server environment and not using memcached for anything else I would opt for APCu over memcached.
If you are already running memcached for other applications, or are in a multiple-frontend-webserver environment, I would go with mecached.
 
Apcu is faster yet more unreliable. From my understanding apc stores data as-is. Whereas all other caching solutions first modify data before storing it.

If that's the case, then wouldn't file cache have the same issue?
 
From what I read memcache, redis etc. all transform data when they store and retreive it, while APC was programmed only for php so they just used pure php data. I unfortunately don't know how the file cache works. To be totally on the safe side, just use memcache on your local server. And if you even want to reduce the tcp overhead, you could use a socket. And yes, APCu did gave me a huge (10% ?) performance improvement but I now stay with memcache.

Memcache is like a Mercedes, and APCu like a car you tune at home in your garage. Sure the APCu is faster, but for reliability there are better options.

Redis is very powerful and is doing less to store data, meaning it should be faster overall. Redis is not supperted by the ZEND Framework 1 xenForo currently uses. There is an addon available for Redis in the Resource Manager.
 
Redis is very powerful and is doing less to store data, meaning it should be faster overall. Redis is not supperted by the ZEND Framework 1 xenForo currently uses. There is an addon available for Redis in the Resource Manager.
I wrote that addon, it has an issue with [db] Widget Framework with its more advanced features that I haven't had time to solve yet.

It is being used by SpaceBattles, and is working quite well, with SB's peak load of ~2000-2200 users online in 15 minutes.

I've got some future plans for getting the underlying ZEND Framework 1 part to support Redis Clustering, but I'm massively busy with other projects unless someone breaks out a checkbook.
 
I wrote that addon, it has an issue with [db] Widget Framework with its more advanced features that I haven't had time to solve yet.

Is there any way to disable pipelining in your addon (so it works with Widget framework) or would that break it enough that its not worth running without it?

-
Thanks for the info everyone.
 
Is there any way to disable pipelining in your addon (so it works with Widget framework) or would that break it enough that its not worth running without it?

-
Thanks for the info everyone.
You can use it without pipelining, just need to not add the following into your config.php
Code:
require(XenForo_Application::getConfigDir().'/SV/RedisCache/Installer.php');

In that configuration, you are just using Redis as a memcache replacement. Biggest bonus is being able to inspect the contents of the cache, and selectively remove keys. Being able to save & load also means restarting doesn't purge the cache.
 
I'm not the kind of person that can answer your question :D
All I can say is APC is only good for PHP 5.4 and lower versions.
Not for PHP 5.5 and up.

Also, the reason why it's not needed for 5.5 or more recent is because that PHP finally have their own opcode cache solution!
Personally I use APC which gave me enough results to speed up the website. APC is non-shared, so if you are the only user on your system. Memcache is only useful if you like do load-balancing across different machines, where the state has to be 'synchronous' across all the machines.
 
Actually there are always two caches:

1. One cache is for making the application faster. Maybe you could say this cache is "executing .php files faster". This is called the opcache. And PHP now has its own integrated opcache solution, when you have one of the latest PHP releases, it's just working.

2. The other cache is for user data. Whenever a user visits a forum, some data is created to identify this user for the time of his stay on that forum. This is the session cache. Even some more data can be stored by this kind of "backend cache". For this you still have to use an additional cache, this is not covered by PHPs new opcache.

APC was doing both jobs. When PHP promoted its former commercial opcache to be included in any PHP release for free, most people used the new official opcache. But there was still need for the user data cache. And this is what APCu is for: It is APC without the opcache: APCu"sercache". So when using "APC" on a single server system my guess is that the best approach would be to just install APCu.

More reliable for handling user data cache is memcache. It is slower than APCu, but it won't make you any headaches.
 
Is there any way to disable pipelining in your addon (so it works with Widget framework) or would that break it enough that its not worth running without it?
I finally had time to look into what was going wrong. My Addon didn't support 'automatic_serialization' properly, as this results in XenForo double serializing things.

I've only just implemented a fix for it.
 
Top Bottom