-
Notifications
You must be signed in to change notification settings - Fork 271
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
The PHP OPcache module is not properly configured #327
Comments
I'm able to demonstrate that opcache is working using the opcache script here: Just with regular usage on a single user I'm able to hit 99% cache hit rate with 2GB, and I can see the cache size change based on the settings I've defined above. Looks like OPCache is enabled by default. |
Others who are more familiar with php's OPCache can chime in, as I haven't worked with it much in the past, but I did do some looking around in the mean time, because I'd like to understand how to help better. Here's some questions and suggestions I came up with:
Regardless of what we find, it might make sense to put in some documentation in the README on how to do this properly, when we figure it out. I'd be happy to review a PR from you or anyone else reading to get this cleared up. It looks like there's a lot of confusion on this accross the docker repo, server repo, and forums with differing resolutions, so at least solidifying how we do things here would be a good first step. |
It is a boolean, so
Setting And what are you even trying to do here? Assign 97% of the opcache memory to strings? Yeah that's a great idea. /s
Apart from the IMHO silly mem allocation, you can also probably not set it via a php_admin_value, if it has been set already once. Then you can only set it for the entire php server and all its pools via the php.ini. You can use https://github.com/gordalina/cachetool to find the actual status, or otherwise just have a look at the functions You will probably find out, that https://bugs.php.net/bug.php?id=71042 is indeed still active and |
@makuser thanks for all your input, but please also remember to be kind when responding to issues. I see you reacted with 👎 to my comment and I'm not sure why, but if you have a solution or want to improve docs, we're happy to take a look at PR either here or in another nextcloud repo upstream. PHP isn't my strong point, but especially if it's already being done in the nextcloud/server or nextcloud/docker repos, we're happy to consider any PRs that would improve the experience of this helm chart 💙 If you do submit a PR, remember to link back to this issue, so that the community can stay on top of the progress and we can close this issue if a fix is found. |
Hi, I have this warning. What is the solution? |
OK, so I have this warning now too, and I've been investigating. I found this related issue upstream: nextcloud/docker#2184 Looks like the docker image sets the following in The Nextcloud maintained all-in-one docker image sets slightly different values, which you can view here. I checked on my $ cat /usr/local/etc/php/conf.d/opcache-recommended.ini
opcache.enable=1
opcache.interned_strings_buffer=32
opcache.max_accelerated_files=10000
opcache.memory_consumption=128
opcache.save_comments=1
opcache.revalidate_freq=60
opcache.jit=1255
opcache.jit_buffer_size=128M What's curious is that if you have nginx enabled, which I do, we don't use that same directory: helm/charts/nextcloud/templates/_helpers.tpl Lines 288 to 292 in 3dfd22e
So, even though I have the following set in my values.yaml, it doesn't actually take effect, and I still get the same warning: nextcloud:
phpConfigs:
opcache.conf: |
php_admin_value[opcache.enable] = 1
php_admin_value[opcache.save_comments] = 1
php_admin_value[opcache.interned_strings_buffer] = 1000
php_admin_value[opcache.memory_consumption] = 1024
php_admin_value[opcache.max_accelerated_files] = 30000
php_admin_value[opcache.validate_timestamps] = 0
php_admin_value[opcache.revalidate_freq] = 60
php_admin_value[memory_limit] = -1 UpdateWait! scratch some of that, maybe all of that on still getting the warning. I recently restarted the container and it looks like the new warning I'm getting is:
so maybe the values are taking effect and what I said about them not taking effect is just false. I am also getting the following in my nextcloud.log that @lenaxia mentioned in their original post here:
🤔 I'm not sure why though. If it's helpful, I'm currently NOT using redis or valkey or anything else. This is JUST the
So, the solution here is to adjust the values as you need directly the way you were doing @lenaxia to whatever your instance needs, however, don't include the Edits: tried to update as I was learning, and reduced some extra text by moving them to links. |
There are the values that worked for me: nextcloud:
phpConfigs:
opcache.conf: |
php_admin_value[memory_limit] = -1
php_admin_value[opcache.jit_buffer_size] = 8M
php_admin_value[opcache.interned_strings_buffer] = 64
php_admin_value[opcache.memory_consumption] = 1G
php_admin_value[opcache.max_accelerated_files] = 30000
php_admin_value[opcache.validate_timestamps] = 0
php_admin_value[opcache.revalidate_freq] = 60 Note: The upstream container already sets @lenaxia and @mike-pisman let me know if this works for you! I'll close this in a month or two if I don't hear anything back from either of you, however if I do close it before either of you are able to respond, you can still respond to the closed issue, and if needed, I, or another nextcloud maintainer/collaborator/membor, can reopen it for you :) Update 12:35 CEST on 17, June 2024Sorry friends. I lied apparently, as I now have the following note in the admin overview again after around an hour or so:
What in the world have I done wrong now... 🤔 Looking into it... Update 13:26 CEST on 17, June 2024The message in the admin overview is gone again 🤔 perhaps it's one of the apps I'm using? I am recognize, photos, memories, and news, which could all be big memory hogs, but I'm not sure... |
Hi, I'm trying to figure out the proper way to configure OPCache based on the helm chart.
I get the following warning in my administration panel:
The PHP OPcache module is not properly configured. See the [documentation ↗](https://docs.nextcloud.com/server/25/go.php?to=admin-php-opcache) for more information. The OPcache buffer is nearly full. To assure that all scripts can be hold in cache, it is recommended to apply opcache.memory_consumption to your PHP configuration with a value higher than 1024.
I am currently trying to configure my OPCache using these configs:
My
nextcloud.log
shows this after startup:Zend OPcache can't be temporary enabled (it may be only disabled till the end of request)
What is the correct way to enable OPCache using the helm chart?
The text was updated successfully, but these errors were encountered: