Need clarity concerning PHP8.0-FPM APCu

There are very different hints in the wild so maybe someone can give clarity to this topic.

I have running a NC 23.0.3 with PHP 8.0.15 under ubuntu server 20.04.4 with 16GB RAM.

My Installation includes php8.0-redis and php8.0-apcu and php8.0-memcache as well

php -f /var/www/nextcloud/cron.php delivers no errors.

In the manual for NC 23 there is following warning

APCu is disabled by default on CLI which could cause issues with nextcloud’s cron jobs. Please make sure you set the apc.enable_cli to 1 on your php.ini config file or append --define apc.enable_cli=1 to the cron job call.

Loocking to my /etc/php/8.0/fpm/php.ini file delivers no results when searching for

apc.enable_cli

but when checking /etc/php/8.0/mods-available i found the apcu.ini with the following

extension=apcu.so
apc.enable_cli=1

My nextcloud config contains

'memcache.local' => '\\OC\\Memcache\\APCu',
  'memcache.distributed' => '\\OC\\Memcache\\Redis',
  'filelocking.enabled' => 'true',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' => 
  array (
    'host' => '/var/run/redis/redis.sock',
    'port' => 0,
    'dbindex' => 0,
    'password' => 'MY-REDIS-SECRET',
    'timeout' => 1.5,
  ),

my /etc/php/8.0/fpm/conf.d contains a symbolic link “20-apcu.ini” pointing to …/mods-available/apcu.ini

So my confusion is now, is everything done with that or is it really nescessary to put the

apc.enable_cli=1 value into my php.ini and if yes in which one?

/etc/php/8.0/cli/php.ini or /etc/php/8.0/fpm/php.ini

Thanks for clarity. If it is not nescessary or if the mods-available entry is enough, why does the admin manual still contain the hint?

Regards
chrissi

Hi @chrissi55

I have it in the /etc/php/8.0/mods-available/apcu.ini and my instance is working perfectley fine, but I suppose both variants would work. However to me the apcu.ini seems the more logical place to put it, since it is a setting specific to the APCu module. In any case there should be no need to add it to both places…

OK thank you for information.

The confusing thing was that the warning as mentioned above definitely says “do … an entry in php.ini…” that sounds like “otherwise … it won’t work…”

They also say “APCu is advised instead of Redis…” when your system has enough RAM.

Don’t know how much is “enough” but hope that all above 10GB is enough :slightly_smiling_face:

I have 8GB of RAM on my server and it’s working fine with APCu. But I only have two users and we hardly ever use the WebUI so your mileage may vary.

As far as I understand it, and I’m by no means an expert on the topic, APCU is better if you have either enough RAM and / or not too many users. I guess at a certain scale there will be point, where APCu is not suitable anymore and you probably will have to use Redis. Or in other words: APCu performs better on a smaller single instance with enough RAM, but has limitations in scalability, while Redis scales better and therefore also can be used for very large installations with several distributed servers and thousands of users.

OK thanks again.
In my case it’s an “ambitious family server” for a group of teachers sharing mediafiles and documents for homeschooling and at school as well.

So max 20 users at the moment at the same time, seems to work good for now.

regards
chrissi