-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Configure the pm.max_children with env var #1766
base: master
Are you sure you want to change the base?
Conversation
b4ca46a
to
bcd3994
Compare
We also got some user(s) requesting this... would be great if it can be added :) |
@J0WI This is a pretty simple fix, can we please expedite this? |
I think it's easier if you just mount your custom configuration to |
@jowi not very easy in kube environment |
That can be done, but at this rate we would also need to completely maintain this as well. So at the very least this setting needs to be increased to be in-sync with the nextcloud docs, at which point we can just as well just merge this and have it done in a more flexible maner right away |
I'm not sure what you mean. For Nextcloud and the other server configs you need a persistent filesystem anyway.
Nextcloud advises to use a value depending on your hardware. There is no meaningful default. |
Well, normally this would be done in a configmap, so it can be done. But to be frank, even Nextcloud doesn't offer this option in their Helm chart, so it offloads more work onto upstreams.
Yes this can ofcoarse be done, but it's rather heavy-handed to scale the complete container just for this setting. and it depends a bit on the quality of the Helm chart on how they support this, but that is indeed not your problem to worry about ;-)
Shoot, I might've based that on a older resource. To be clear: I don't expect all "convienient" settings to be exposed this way, as that would be weird. But at least exposing the settings nextcloud advices to tweak seems like the best way. It also prevents users from asking "how can I tweak this, because Nextcloud advices me to tweak it".... |
@J0WI It's a shame that php-docker points to upstream php though (which is also not 100% correct, as they don't mind adding other settings). Imho this should be solved for as many users as possible, so that's why i'm hesitent to make it a downstream modification |
Since upstream php-docker won't accept the change, can we revisit this PR please? |
Does this even work? The FPM config usually lives in |
Could I know if I want to add my override config for pm.max_children, what should I mount to the nextcloud:fpm docker container? |
They are applied alphabetically. You can prefix your file with |
Awesome info! |
Dockerfile-debian.template
Outdated
@@ -106,6 +107,7 @@ RUN { \ | |||
echo 'memory_limit=${PHP_MEMORY_LIMIT}'; \ | |||
echo 'upload_max_filesize=${PHP_UPLOAD_LIMIT}'; \ | |||
echo 'post_max_size=${PHP_UPLOAD_LIMIT}'; \ | |||
echo 'pm.max_children = ${PHP_PM_MAX_CHILDREN}'; \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FPM parameters don't belong in the php.ini path (PHP_INI_DIR). FPM stuff needs to go into the php-fpm.d/ path.
We don't currently customize anything FPM related in the Dockerfile but it can probably be modeled after the PHP_INI_DIR stuff. Perhaps /usr/local/etc/php-fpm.d/nextcloud.ini or something like that
As currently coded, at best this parameter gets ignored.
As a workaround I use this in a docker-compose file: nextcloud:
image: library/nextcloud:26.0.1-fpm-alpine
...
command: >-
sh -c '
{
echo pm=dynamic;
echo pm.max_children=120;
echo pm.start_servers=12;
echo pm.min_spare_servers=6;
echo pm.max_spare_servers=18;
} >> /usr/local/etc/php-fpm.d/www.conf;
exec php-fpm
' |
@escoand @joshtrichards Don't do this please. This may cause upgrade issues like #2005. Longer: You are overriding the entrypoint/command of Nextcloud. As such, on any upgrade the upgrade script may not run/trigger anymore and you may get errors, because you try to start your NC without upgrading to the new version. # workaround for php-fpm issue https://github.com/nextcloud/docker/pull/1766
- type: bind
source: ./php-fpm-config/zz-prevent-servererror-onload.conf
target: /usr/local/etc/php-fpm.d/zz-prevent-servererror-onload.conf:z ( …and add the config lines from above in the corresponding file. Better mount the config file in there. I also just noticed this as I fall into the same trap. 😜 |
@rugk I try to avoid additional files and just have it in the docker-compose. To circumvent this problem you could use: nextcloud:
image: library/nextcloud:26.0.1-fpm-alpine
...
command: >-
sh -c '
{
echo pm=dynamic;
echo pm.max_children=120;
echo pm.start_servers=12;
echo pm.min_spare_servers=6;
echo pm.max_spare_servers=18;
} >> /usr/local/etc/php-fpm.d/www.conf;
exec /entrypoint.sh php-fpm
' |
Waiting docker-library/php#1452 to move configuration entries in good directory |
04bd05c
to
7dc3c98
Compare
Signed-off-by: Thomas Clavier <tom@tcweb.org>
This reverts commit 4ce703e. Signed-off-by: Thomas Clavier <tom@tcweb.org>
Signed-off-by: Thomas Clavier <tom@tcweb.org>
No description provided.