Skip to content

[Bug]: Server hangs as php-fpm reach pm.max_children limit #39063

@ThibautPlg

Description

@ThibautPlg

⚠️ This issue respects the following points: ⚠️

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:

  • The servers are only hosting one Nextcloud server, with php 8.1
  • php-fpm max_children and other configuration values have been customized to match the available RAM of the host (between 32 to 64 childs allowed)
  • The php-fpm max children have never been a problem as far as I recall (some instances are older than NC20). The problem also occurs on newly installed testing instances.
  • The ram consumption is average, we're not maxed
  • I've tried with php8.2, same results

systemctl status php-fpm.service output when server is down:

● php-fpm.service - The PHP FastCGI Process Manager
   Loaded: loaded (/usr/lib/systemd/system/php-fpm.service; enabled; vendor preset: disabled)
   Active: active (running) since Wed 2023-06-28 14:30:57 CEST; 24h ago
  Process: 3345857 ExecReload=/bin/kill -USR2 $MAINPID (code=exited, status=0/SUCCESS)
 Main PID: 462753 (php-fpm)
   Status: "Processes active: 64, idle: 2, Requests: 127550, slow: 0, Traffic: 0req/sec"
    Tasks: 67 (limit: 47993)
   Memory: 1.7G
   CGroup: /system.slice/php-fpm.service
           ├─ 462753 php-fpm: master process (/etc/php-fpm.conf)
           ├─ 613484 php-fpm: pool nextcloud
           ├─ 613485 php-fpm: pool nextcloud
           ├─ 613486 php-fpm: pool nextcloud
           ├─ 613487 php-fpm: pool nextcloud
           ├─ 613488 php-fpm: pool nextcloud
           ├─ 613489 php-fpm: pool nextcloud
(the list goes on)

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

  1. Upgrade to NC26 or install a fresh server
  2. Wait a little bit
  3. Observe php-fpm being overwhelmed

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?

  • Default user-backend (database)
  • LDAP/ Active Directory
  • SSO - SAML
  • Other

Configuration report

No response

List of activated Apps

No response

Nextcloud Signing status

No response

Nextcloud Logs

No response

Additional info

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions