OPcache issue overflow

Support intro

Sorry to hear you’re facing problems. :slightly_frowning_face:

The community help forum (help.nextcloud.com) is for home and non-enterprise users. Support is provided by other community members on a best effort / “as available” basis. All of those responding are volunteering their time to help you.

If you’re using Nextcloud in a business/critical setting, paid and SLA-based support services can be accessed via portal.nextcloud.com where Nextcloud engineers can help ensure your business keeps running smoothly.

Getting help

In order to help you as efficiently (and quickly!) as possible, please fill in as much of the below requested information as you can.

Before clicking submit: Please check if your query is already addressed via the following resources:

(Utilizing these existing resources is typically faster. It also helps reduce the load on our generous volunteers while elevating the signal to noise ratio of the forums otherwise arising from the same queries being posted repeatedly).

The Basics

  • Nextcloud Server version (e.g., 29.x.x):
    • Nextcloud Hub 10 (31.0.9)
  • Operating system and version (e.g., Ubuntu 24.04):
    • Ubuntu Linux 24.04.3
  • Web server and version (e.g, Apache 2.4.25):
    • Apache 2.4
  • Reverse proxy and version _(e.g. nginx 1.27.2)
    • NO
  • PHP version (e.g, 8.3):
    • 8.3
  • Is this the first time you’ve seen this error? (Yes / No):
    • Yes
  • When did this problem seem to first start?
    • Migration from Plesk to Virtualmin
  • Installation method (e.g. AlO, NCP, Bare Metal/Archive, etc.)
    • script, now imported with the backup
  • Are you using CloudfIare, mod_security, or similar? (Yes / No)
    • no

Summary of the issue you are facing:

After migrating from the Plesk Panel to a Virtualmin panel Nextcloud show the following issue:

The PHP OPcache module is not configured correctly. The OPcache buffer is almost full. To ensure that all scripts can be cached, it is recommended to apply “opcache.memory_consumption” to your PHP configuration with a value greater than “4096.” The OPcache interned strings buffer is nearly full. To ensure that repeating strings can be cached effectively, it is recommended to apply “opcache.interned_strings_buffer” to your PHP configuration with a value greater than “512.”

Configuration

Nextcloud

The output of occ config:list system or similar is best, but, if not possible, the contents of your config.php file from /path/to/nextcloud is fine (make sure to remove any identifiable information!):

Link

Apps

The output of occ app:list (if possible):

Link

Any idea on how to fix?
I created a small php file to look into Opcache and discovered the cache is not used only by Nextcloud but also from other Wordpress install on other domain (virtual server) on Virtualmin.

My VPS

8 vCore
CPU
16 GB
RAM
480 GB
NVMe

such a setup_warning always comes with a link to docs.. forum search and checking relevant tags like opcache helps as well

I did already before post here.
I tried to change the configuration increasing parameters but this did not help.

OPcache is active.

I don’t remember having this problem with the Plesk panel. The problem is probably how Virtualin handles OPcache. I really don’t know how to fix it.

The issue was on configure OPcache on Virtualmin.

I was using Plesk and migrated just recently to the Virtualmin panel so I’m learning how to manage it.

Opcache experiences saturation issues when using Nextcloud and Virtualmin.
If not configured correctly, it can generate random 500 errors in the browser.

Complete Guide: Configuring OPcache for Virtualmin and Nextcloud

:one: Identifying the correct PHP-FPM

Log in to the server via SSH as root.
Check which PHP FPM is using for the Nextcloud domain:

php -i | grep “Loaded Configuration File”

This will show you the active php.ini, e.g., /etc/php/8.3/fpm/php.ini.
Check for any overrides in the conf.d files:

ls /etc/php/8.3/fpm/conf.d | grep opcache

Usually, there’s 10-opcache.ini.

:two: Edit the OPcache configuration

Open the 10-opcache.ini file:

nano /etc/php/8.3/fpm/conf.d/10-opcache.ini

Add or edit this block (Nextcloud-friendly):

zend_extension=opcache.so
opcache.jit=off
opcache.enable=1
opcache.memory_consumption=512 ; 512 MB for OPcache
opcache.interned_strings_buffer=64 ; buffer stringhe, 64 MB
opcache.max_accelerated_files=60000 ; max number of script memorized
opcache.revalidate_freq=60 ; check timestamp every 60 sec
opcache.validate_timestamps=1

:warning: If there are duplicate parameters in other conf.d .ini files, make sure they don’t overwrite these values.

:three: Restart PHP-FPM and Apache

After saving the file:

systemctl daemon-reload
systemctl restart php8.3-fpm
systemctl restart apache2

Check the status of services:

systemctl status php8.3-fpm
systemctl status apache2

Verify on Nextcloud

2 Likes

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.