-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Division by zero in file 'apps/settings/lib/Controller/CheckSetupController.php' line 503 #30532
Comments
Can you replace lines 503-505 of that file server/apps/settings/lib/Controller/CheckSetupController.php Lines 503 to 505 in 5598638
by
and check if error is fixed? |
Thanks for reporting. I'll add a check for the value being zero, before doing the division. It makes sense that during updates, where the cache is invalidated, there are short time frames where the interned strings buffer has not been used yet. @acsfer EDIT: Ah, it's free strings buffer which is divided by. Now I'm wondering, if zero internet strings buffer is free, then the warning should actually be shown 🤔. @nursoda <?php echo '<pre>'; print_r(opcache_get_status(false)); echo '</pre>'; |
Fixes: #30532 Signed-off-by: MichaIng <micha@dietpi.com>
|
I inserted the !empty check and the error persists, now in line 504…which is logical since the array does contain data but free_memory yields "0". Strange, that does free_memory mean here? Here's my output of the
|
That server was booted just a day ago and did run without opcache issues for at least two years now, including all NC updates done the same way. So, what is special about NC23.0.1RC1 that causes opcache to be full after just a few minutes? |
After inserting
What I consider strange about this is that I never saw this warning in the last two years, in fact never since I run NCs on my machines. So, the only thing I changed was … the update to NC 23.0.1 RC1. |
Okay, so the OPcache interned strings buffer was completely filled. In this case the aim is to show a warning that it should be increased. In your PHP settings, you can do that via
It is not about the system memory, but the amount of memory which the PHP OPcache is allowed to use, for caching PHP scripts in opcode, to increase access performance.
Prior to NC23, the admin panel basically checked whether the default values (or higher) for OPcache are applied, and if not showed a recommendation to apply the defaults. Now the recommendation is based on the actual usage, hence when any of the three possible OPcache limits (number of cached keys/strings, overall memory usage, interned strings buffer) is more than 90% filled, you see a recommendation to raise the setting. However, actually I tried hard to get the default 128 MiB OPcache filled with a test Nextcloud instance by installing and accessing literally all available apps, and I wasn't able to reach more than a little over 64 MiB only. So it is quite interesting that in your case 128 MiB are nearly fully used. Do you run other PHP applications on the same webserver/PHP instance? |
Yes. The server currently runs 9 NC instances, 3 WP instances and one Contao instance, all PHP based. And some handmade PHP scripts (called rarely). I might have overdone it, but I set the opcache values as follows …
… and restarted php-fpm. After that, I see "All checks passed." in
As I can confirm that the PR closes the issue, it's all fine with me now. Thanks for the explanation. Yet, I expect the warning to propose reasonable values, not only "set it to more than [current setting]". |
That is practically impossible do achieve, I'm afraid 🤔. We can only see how much the OPcache is currently used, but we have no change to know how much would be used when raising the settings. What could make sense is in case of the interned strings buffer is to show the next power of 2 as recommendation, since powers of 2 seem to be expected. Though other values work, it behaves a bit strange and is badly documented. I tried to get some clarification via PHP developers channel and StackExchange, but there are still open questions: https://stackoverflow.com/questions/67853338/opcache-interned-strings-buffer-size-lower-than-opcache-interned-strings-buffer In case of the number of cached keys we should recommend to apply the next of the effectively used prime numbers: When e.g. So in your case it could have been iterative, e.g. you double the settings until the recommendations are gone. At least there is now one, in your case with still plenty of free system RAM you may get a notable performance benefit 🙂.
Looks like 😄. Btw, while the stats script works fine already, there is actually a nice GUI for monitoring and managing (invalidating all or individual scripts) the OPcache: https://github.com/amnuts/opcache-gui |
Thanks again for all the explanation, I think this "bug" is worth reading.
I consider this a good proposal to users/admins. Probably not in the warning itself but in a section within the admin manual. Also, links to https://www.php.net/manual/en/opcache.configuration.php and https://github.com/amnuts/opcache-gui would be nice in the admin manual. To me it's still unclear what impact max_accelerated_files has on memory usage and how it should be set in relation to memory_consumption and interned_strings_buffer. From the stackoverflow answer I deduct that interned_strings_buffer is a subset of memory_consumption, so a reasonaby ratio may be 1:4 or 1:100? But for max_accelerated_files?
I'd be happy if there were a speedup but I doubt it and don't have means to compare/measure it. As I already had basic opcache, redis is set up, my system does not use swap and is SSD only, I don't expect a leap in speed. |
Too much info right in the admin panel isn't good either, the proposed changes to the Nextcloud documentation are here (which includes the two links you suggested 🙂): nextcloud/documentation#7859
Basically none, as long as the limit is not hit (it never was in your case).
Yes, the interned strings buffer is shown as "used" from the overall OPcache memory consumption right from the start, so increasing the interned strings buffer may require increasing the overall OPcache memory consumption as well. The default ratio is 128:8 = 16:1, but it depends highly on the applications. E.g. a forum or blog usually stores a lot more strings compared to Nextcloud. So best is to not think in ratios here but simply check the actual usage and increase (or reduce) the one or the other so that each is not full + has a little space to grow.
Probably not. Also the |
Fixes: #30532 Signed-off-by: MichaIng <micha@dietpi.com>
Fixes: #30532 Signed-off-by: MichaIng <micha@dietpi.com>
Fixes: #30532 Signed-off-by: MichaIng <micha@dietpi.com>
I just updated via
settings/admin/overview
from 23.0.0 to 23.0.1 RC1 (on beta channel), then reloadedsettings/admin/overview
three times. The first two times there was a warning that I shall update indices via occ or similar, since the third time I always get this error onsettings/admin/logging
:and in
nextcloud.log
respectively:Operating system: Arch Linux
Web server: NGINX
Database: MariaDB
PHP version: 8.0
The text was updated successfully, but these errors were encountered: