Closed LouisOuellet closed 1 year ago
cc @MichaIng
Please try the following:
For still unknown reasons, some web applications (I observe the same on one Wordpress instance) and in case of Nextcloud some apps or combination of apps or usage cases, fill the interned strings buffer without limit. It might be an OPcache issue if e.g. no proper garbage collection is done or strings from cached PHP scripts are not evicted once the script itself is. I don't know a way to investigate since there is no API at all for the interned strings buffer to e.g. check the content or evict strings.
However, in affected cases this could have led to a cycle of:
So with a recent Nextcloud version we changed the check to only show an interned strings buffer recommendation if it is below 25% of the overall OPcache size, otherwise we assume that it just be filled without limit. On usual Nextcloud instances btw the interned strings buffer usage is somewhere around 4 MiB, 2.72 MiB currently on my personal instance, so 25% of 128 MiB = 32 MiB is already far above the expected need.
Here are my php settings for the nextcloud instance:
memory_limit=4G
upload_max_filesize = 32G
post_max_size = 32G
upload_tmp_dir = /var/www/cloud.albgroupe.com/home/albmanagercloud/tmp/
opcache.enable=1
opcache.interned_strings_buffer=256
opcache.max_accelerated_files=10000
opcache.memory_consumption=1024
opcache.save_comments=1
opcache.validate_timestamps=0
disable_functions =
Note, I am using ISPConfig as a web panel to manage all web services. So these settings are only for the nextcloud site. I tried increasing both opcache.interned_strings_buffer
and opcache.memory_consumption
to 10x the above limit and still have the error.
The server I am using has 128gb of RAM and is using a RAID10 array of SSDs for storage. Increasing the limit to 10gb is not a problem. But I also doubt Nextcloud needs that much either.
Again, please try to:
opcache.interned_strings_buffer
, opcache.max_accelerated_files
and opcache.memory_consumption
, restart PHPopcache.memory_consumption
a recommendation. You should not it if this is for a single Nextcloud instance only, as it uses 20-50 MiB and not the 1024 MiB you applied. However, if you do see it (OPcache shared among multiple instances/web applications), then raise opcache.memory_consumption
until the recommendation is gone. Restart PHP after each change!opcache.interned_strings_buffer
to 25% of opcache.memory_consumption
and restart PHP.If afterwards the warning still shows up, that settings are not applied correctly. You can verify this e.g. via https://github.com/amnuts/opcache-gui: Put it into your web dir and access it directly to see actual OPcache settings and usage.
Ok I removed all the opcache settings and it not giving any errors about opcache anymore. Is there a way to confirm that nextcloud can still use it though? and that it is using it?
It is not Nextcloud which uses it but this is all handled automatically PHP-internally. If OPcache is enabled (which is by default since PHP 7.0), PHP automatically caches the opcode of all loaded PHP scripts up to the limits, including "interned strings". You can check cache usage and a list of all cached scripts with https://github.com/amnuts/opcache-gui.
Since scripts are cached on load/demand, the recommendation (it is not an "error"!) may show up at a later time.
Ok I will continue to monitor it.
⚠️ This issue respects the following points: ⚠️
Bug description
The PHP OPcache module is not properly configured. See the documentation ↗ for more information. 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 1024.
So I am running version 25.0.5. Been encountering this error for a while. Kept increasing the limit but it always comes back. Even pushed the limit to 10gb, still would return the error. There seems to be something wrong with OPcache and Nextcloud Hub 25.
Note that I have several large network shares connected using external storage.
Steps to reproduce
Expected behavior
Cache should regenerate according to demand.
Installation method
Community Manual installation with Archive
Nextcloud Server version
25
Operating system
Debian/Ubuntu
PHP engine version
PHP 8.1
Web server
Apache (supported)
Database engine version
MariaDB
Is this bug present after an update or on a fresh install?
None
Are you using the Nextcloud Server Encryption module?
None
What user-backends are you using?
Configuration report
List of activated Apps
Nextcloud Signing status
Nextcloud Logs
Additional info
No response