]> source.dussan.org Git - nextcloud-server.git/commitdiff
Fix interned strings buffer check if 0 free bytes 36278/head
authorMichaIng <micha@dietpi.com>
Fri, 20 Jan 2023 20:59:30 +0000 (21:59 +0100)
committerSimon L. (Rebase PR Action) <szaimen@e.mail.de>
Mon, 23 Jan 2023 08:55:35 +0000 (08:55 +0000)
With #32902 it was meant to be avoided to recommend raising the interned strings buffer size above a quarter of the total OPcache size. This works as long as there is at least 1 byte free, but does not apply if the buffer is filled completely.

This commit switches the conditions so that the interned strings buffer size must be smaller than a quarter of the total OPcache size for the warning to be shown. That the buffer must be either filled completely or by more than 90% remains untouched.

Signed-off-by: MichaIng <micha@dietpi.com>
apps/settings/lib/Controller/CheckSetupController.php

index eaaacc3fd220c89973b46343ada39971f7ed5675..a5c158d2602da3fe39e447588f9e0f98124103fd 100644 (file)
@@ -524,11 +524,11 @@ Raw output
                        }
 
                        if (
-                               empty($status['interned_strings_usage']['free_memory']) ||
+                               // Do not recommend to raise the interned strings buffer size above a quarter of the total OPcache size
+                               ($this->iniGetWrapper->getNumeric('opcache.interned_strings_buffer') < $this->iniGetWrapper->getNumeric('opcache.memory_consumption') / 4) &&
                                (
-                                       ($status['interned_strings_usage']['used_memory'] / $status['interned_strings_usage']['free_memory'] > 9) &&
-                                       // Do not recommend to raise the interned strings buffer size above a quarter of the total OPcache size
-                                       ($this->iniGetWrapper->getNumeric('opcache.interned_strings_buffer') < $this->iniGetWrapper->getNumeric('opcache.memory_consumption') / 4)
+                                       empty($status['interned_strings_usage']['free_memory']) ||
+                                       ($status['interned_strings_usage']['used_memory'] / $status['interned_strings_usage']['free_memory'] > 9)
                                )
                        ) {
                                $recommendations[] = $this->l10n->t('The OPcache interned strings buffer is nearly full. To assure that repeating strings can be effectively cached, it is recommended to apply <code>opcache.interned_strings_buffer</code> to your PHP configuration with a value higher than <code>%s</code>.', [($this->iniGetWrapper->getNumeric('opcache.interned_strings_buffer') ?: 'currently')]);