Caching has potentially stopped working since 9.0.52 > 10.0.0.0 upgrade

A little ominous, but I’ve not noticed any difference in performance thus far. I’m seeing the following in my log frequently:

Info	cli	Memcache \OC\Memcache\APCu not available for distributed cache	2016-08-31T13:15:01+00:00	--
Info	cli	Memcache \OC\Memcache\APCu not available for local cache	2016-08-31T13:15:01+00:00	--

Here’s the relevant config.php extract:

'memcache.local' => '\\OC\\Memcache\\APCu',
  'filelocking.enabled' => 'true',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' =>
  array (
    'host' => '/var/run/redis/redis.sock',
    'port' => 0,
    'timeout' => 0.0,
  ),

I don’t have a distributed option in there, and given it’s a single server didn’t think I’d need it, but local is set.

@tflidd @LukasReschke any ideas please?

Can you post your phpinfo?

https://bayton.org/paste/?b7fe80cf70b0ee13#PTTuvwuXkWx4hWDIbM9IDBqC++cQCMc66OVf72O5ZtM=

I already saw acpu support = disabled in there… but that doesn’t explain why.

That sounds more like a setup issue with your php

If you don’t specify a distrubuted cache we use the same as the localcache. This is where the double warning comes from. This is done so we have fewer code paths.

Following: Redirect Notice

Makes no mention of changing my PHP setup. I installed ACPu, enabled ACPu and popped the relevant config in config.php. So it should just work.

Well if your PHPinfo tells you that APCu is disabled then there is no way for Nextcloud to magically enable it of course :wink:

I’m not an ubuntu user. But I’m sure there are guides for php7 for ubuntu on how to enable APCu

OK, it took some Googling, but essentially it looks as though the /etc/php/7.0/apache2/conf.d/20-apcu.ini file has only one entry:

extension=apcu.so

So I added the following based on three sources I found who’d configured it (plus a closed github issue from some random project):

apc.enabled=1
apc.enable_cli=1
apc.shm_size=128M
apc.ttl=3600
apc.user_ttl=7200
apc.gc_ttl=3600

Restarted apache, and now APCu is showing as enabled.

This likely needs documenting in the NC docs, along with recommended defaults for the above settings (and other settings if required, I think I’ve got the minimum listed there).

1 Like

Logs are now clean of APCu errors, so that was that.

It’d be interesting to know why installing and enabled APCu on PHP7 didn’t pre-populate the required fields as I presume it does in PHP5 (otherwise there’d be countless threads on this, right?).

There you need to ask the distribution which ships the packages for you. In most cases, manually added php-modules are enabled. PHP7 is quite new, and I’m not sure if all the caching solutions were available from the beginning (in a stable version). But that’s just a guess.

Indeed the module was enabled, but the required settings within the module to turn it on were missing.
I may need to add this to my guide.

Would anyone with a working APCu be able to provide their config at path/to/etc/php/module/apcu.ini or from their php.ini?

Bump.

Though the caching now works OK, I’d be happier knowing the APCu “default” settings I should be using.

Can you describe what you have done to make your caching works ?

Scroll up a bit and the post marked as the solution indicates what I added where.

Well, done the same thing, nothing more than the cache directory is generated :confused:
Thanks anyway

Does NC report the cache being unavailable in the logs still for you?

I got nothing in the logs, just a cache directory with sub-directories named like the user of my cloud, but nothing in them.

An ls -l /path/to/user/cache shows 0, but ls -la indicates there are over 500 records for my main user account. I think it’s doing something, though maybe @rullzer or @tflidd can shine some more light on the subject.

Just have a look what the option -a stands for:

  -a, --all                  do not ignore entries starting with .

the folder /path/to/nextcloud/data/user/cache is mainly used for uploads (client uploads chunks of files which are then assembled once all of them are received). Not sure if there is also other stuff. But in most cases the folder should be pretty empty unless you are uploading something.

APCU/redis manage their cache at a different location. Check the redis/apcu documentation if you are interested in more details (e.g. runtime information).