Page MenuHomePhorge

Setup: Show Setup Warning if PHP opcache is Not Effective
Open, WishlistPublic

Description

This week in my personal Nextcloud I've seen this warning:

The OPcache buffer is nearly full. To assure that all scripts can be hold in cache, it is recommended to apply opcache.memory_consumption to your PHP configuration with a value higher than currently.
https://docs.nextcloud.com/server/23/go.php?to=admin-php-opcache

I think that Phorge could inform administrators about the same performance issue, so to speedup their Phorge even more.

Exploration

It seems that this information can be fetched through the PHP API opcache_get_status():

https://www.php.net/manual/en/function.opcache-get-status.php

So I guess that what is important, is this:

'interned_strings_usage' =>
array(4) {
  'buffer_size' =>
  int(8388608)
  'used_memory' =>
  int(2593616)
  'free_memory' =>
  int(5794992)
  'number_of_strings' =>
  int(10358)
}

I've also probably found where Nextcloud generates these warnings:

https://github.com/nextcloud/server/issues/44353#issuecomment-2009659136

https://github.com/nextcloud/server/blob/bb795239b529c67c50eafa65d416b0acf63a0890/apps/settings/lib/SetupChecks/PhpOpcacheSetup.php#L66 (latest change, Jul 8, 2024)

So this seems feasible.