Skip to content

Commit 8abfc5d

Browse files
MichaIngbackportbot[bot]
authored andcommitted
Update OPcache documentation
Remove the settings block which matches PHP defaults anyway. The Nextcloud admin panel will now show warnings based on actual OPcache usage, when any limit is closely reached: nextcloud/server#27403 Add info about how to enhance performance by reducing or disabling OPcache revalidation. Remove link to outdated blog post, which contains no additional helpful information and the invalid "opcache.fast_shutdown" setting which was removed with PHP7.2 already. Instead, add a link to "opcache-gui", a web interface to monitor and control the OPcache. Signed-off-by: MichaIng <micha@dietpi.com>
1 parent 8640871 commit 8abfc5d

1 file changed

Lines changed: 16 additions & 7 deletions

File tree

admin_manual/installation/server_tuning.rst

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -102,15 +102,24 @@ more processes to run in parallel to handle the requests.
102102
Enable PHP OPcache
103103
------------------
104104

105-
The `OPcache <https://php.net/manual/en/intro.opcache.php>`_ improves the performance of PHP applications by caching precompiled bytecode. We recommend at least the following settings:
105+
The `OPcache <https://php.net/manual/en/intro.opcache.php>`_ improves the performance of PHP applications by caching precompiled bytecode. The default OPcache settings are usually sufficient for Nextcloud code to be fully cached. If any cache size limit is reached by more than 90%, the admin panel will show a related warning. Nextcloud strictly requires code comments to be preserved in opcode, which is the default. But in case PHP settings are changed on your system, you may need set the following:
106106

107107
.. code:: ini
108108
109-
opcache.enable = 1
110-
opcache.interned_strings_buffer = 8
111-
opcache.max_accelerated_files = 10000
112-
opcache.memory_consumption = 128
113109
opcache.save_comments = 1
114-
opcache.revalidate_freq = 1
115110
116-
For more details check out the `official documentation <https://php.net/manual/en/opcache.configuration.php>`_ or `this blog post about some recommended settings <https://www.scalingphpbook.com/blog/2014/02/14/best-zend-opcache-settings.html>`_.
111+
By default, cached scripts are revalidated on access to ensure that changes on disk take effect after at most ``2`` seconds. Since Nextcloud handles cache revalidation internally when required, the revalidation frequency can be reduced or completely disabled to enhance performance. Note, however, that it affects manual changes to scripts, including ``config.php``. To check for changes at most every ``60`` seconds, use the following setting:
112+
113+
.. code:: ini
114+
115+
opcache.revalidate_freq = 60
116+
117+
To disable the revalidation completely:
118+
119+
.. code:: ini
120+
121+
opcache.validate_timestamps = 0
122+
123+
Any change to ``config.php`` will then require either restarting PHP, manually clearing the cache, or invalidating this particular script.
124+
125+
For more details check out the `official documentation <https://php.net/manual/en/opcache.configuration.php>`_. To monitor OPcache usage, clear individual or all cache entries, `opcache-gui <https://github.com/amnuts/opcache-gui>`_ can be used.

0 commit comments

Comments
 (0)