OPcache: Unterschied zwischen den Versionen

Aus Foxwiki
Die Seite wurde neu angelegt: „Kategorie:Nextcloud:Verwaltung
 
Keine Bearbeitungszusammenfassung
Zeile 1: Zeile 1:
[[Kategorie:Nextcloud:Verwaltung]]
[[Kategorie:Nextcloud:Verwaltung]]
== Enable PHP OPcache ==
The OPcache 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:
opcache.save_comments = 1
By default, cached scripts are revalidated on access to ensure that changes on disk take effect after at most <code>2</code> 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 <code>config.php</code>. To check for changes at most every <code>60</code> seconds, use the following setting:
opcache.revalidate_freq = 60
To disable the revalidation completely:
opcache.validate_timestamps = 0
Any change to <code>config.php</code> will then require either restarting PHP, manually clearing the cache, or invalidating this particular script.
For more details check out the official documentation. To monitor OPcache usage, clear individual or all cache entries, opcache-gui can be used.

Version vom 19. Januar 2023, 14:08 Uhr


Enable PHP OPcache

The OPcache 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:

opcache.save_comments = 1

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:

opcache.revalidate_freq = 60

To disable the revalidation completely:

opcache.validate_timestamps = 0

Any change to config.php will then require either restarting PHP, manually clearing the cache, or invalidating this particular script.

For more details check out the official documentation. To monitor OPcache usage, clear individual or all cache entries, opcache-gui can be used.