-
-
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
[Bug]: Server hangs as php-fpm reach pm.max_children limit #39063
Comments
Hi @ThibautPlg: There are a lot of possibilities, but you didn't provide a complete Issue form. :-) The most important items to check off the top of my head that might provide clues:
Are all of these instances essentially similarly configured/built? While anything is possible, chances are this is some sort of local environment interaction. I would suggest posting this in the Nextcloud Help Forum first. NC26 has been out awhile and I haven't seen rampant reports of new php-fpm related issues personally. |
@ThibautPlg Does this issue disappear when you disable previews? We have an instance where php-fpm is stuck with requests like |
Hi In the end we "fixed" the problem by adding the following line to our php-fpm config : |
on my instance this started with 25.0.9 or 25.0.10. ltoday I upgraded to 26.0.5, I will check in the next days the issue persists... preview was all the disabled |
I am experiencing this issue too and I also noticed it since the upgrade to |
Actually setting I think the problem might be related to nextcloud server either not closing database connections or not recycling them in future requests because I've observed that database connections increase at the same pace that workers. This issue is causing a lot of troubles in all my instances. I am surprised that it is not getting more attention. |
The request_terminate_timeout is indeed only a workaround. We've also noticed a high increase in mariadb connections prior to a total overflow of php-fpm processes. |
I see exactly the same result like @ThibautPlg reported, however on a slightly different system:
However, it is mod_php instead of PHP-FPM, but all Apache webserver processes are stuck at
And on this system, the |
had a similar issue a one week ago - did increase pm.max_children and there was some process, which eat my whole memory (php-fpm setting was set to "on demand"). I did play with php-fpm setting "static" and "dynamic" - but both eat too much memory. So i switched back to setting: "ondemand" This calculation helped me finding the right values: pm.process_idle_timeout = 10 (see: ; ondemand - no children are created at startup. Children will be forked when ) So far so long - no memory issues with php-fpm at all. AvailableRAM=$(awk '/MemAvailable/ {printf "%d", $2/1024}' /proc/meminfo) Calculation PHP-FPM-Tweaks:AvailableRAM:6457
|
For me this was fixed in |
i'm om 27.1.4 |
I'm still observing this on one of my instances running 27.1.6. I've been incrementally increasing pm.max_children, 12, 20, 30, 40, 50. Each time as soon as Using PHP-FPM 8.2.7 and Apache 2.4.57 |
I agree that started observing a similar behavior again. This time the processes dissappear after a few minutes, but still it creates the problem of having many processes doing nothing and the service becoming unavailable. |
I don't want to tempt fate here, but I MAY have resolved my instance by adjusting a different php.ini parameter. I'm kicking myself now for not specifically noting which one, but I was in a hurry at the time. I can say that I wouldn't have known to do it except for a suggestion that showed up in the Nextcloud Administration Settings > Overview panel under Security & setup warnings ONLY after the pm.max_children warning appearing in the system php log, but before the Nextcloud web interface became unresponsive. It was a pretty brief window, but still catchable if you set up some kind of trigger to watch the log file. It could also be total coincidence :-P |
as i've written - switched back to setting: "ondemand" - on all problems solved |
Alright, so my earlier victory was ultimately short-lived, and probably coincidental. The thing that ACTUALLY seems to have fixed this for me was installing php-smbclient. My NC instance is entirely a mounted SMB external share, and without php-smbclient, any file transfer that took too long or was larger than 512MB would hang and lock up a child process until there were no more available and the server would stop processing requests. |
Just for reference, similar symptoms can appear if you use keepalive between Apache and php-fpm. Not sure why but it's probably unnecessary either way if you run php-fpm on the same machine especially if using unix-sockets |
Bug description
Hello,
I'm administrating multiple Nextcloud 25 instances, and I'm slowly upgrading to Nextcloud 26. However, after some days (some hours sometimes), each and every instance upgraded to Nextcloud 26 crash due to the php-fpm pm.max_children limit being reached.
I then need to restart php-fpm and everything goes normal until the next crash.
Additional context:
systemctl status php-fpm.service
output when server is down:I feel like some processes are idle (hanged?) and never stopped.
Am I the only one facing this issue? Why does it occurs only with NC26? What has changed regarding php processes?
Best regards,
Steps to reproduce
Expected behavior
Same as before, Nextcloud (php-fpm?) should remove children.
Installation method
None
Nextcloud Server version
26
Operating system
RHEL/CentOS
PHP engine version
PHP 8.1
Web server
Nginx
Database engine version
None
Is this bug present after an update or on a fresh install?
None
Are you using the Nextcloud Server Encryption module?
Encryption is Disabled
What user-backends are you using?
Configuration report
No response
List of activated Apps
No response
Nextcloud Signing status
No response
Nextcloud Logs
No response
Additional info
No response
The text was updated successfully, but these errors were encountered: