PHP-FPM exceeds max children

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can. :heart:

The Basics

  • Nextcloud Server version (e.g., 29.x.x):
    • 30.0.4
  • Operating system and version (e.g., Ubuntu 24.04):
    • Ubuntu 22.04
  • Web server and version (e.g, Apache 2.4.25):
    • Apache/2.4.52
  • Reverse proxy and version _(e.g. nginx 1.27.2)
    • HAProxy 2.8.5
  • PHP version (e.g, 8.3):
    • 8.3
  • Is this the first time you’ve seen this error? (Yes / No):
    • Yes
  • When did this problem seem to first start?
    • End of December
  • Installation method (e.g. AlO, NCP, Bare Metal/Archive, etc.)
    • Bare metal in LXC
  • Are you using CloudfIare, mod_security, or similar? (Yes / No)
    • No

Summary of the issue you are facing:

I cannot get any response from the backend. There is connection to Apache, but no response from the application.
I found the following in the log file for PHP-FPM:

server reached pm.max_children setting (8), consider raising it

I have never had the need to tweak anything in here, and this service has been running for years. I raised it to 40 and tweaked the remaining settings to fit the 40 and restarted. It seemed to work. For two days. Then it returned.

server reached pm.max_children setting (40), consider raising it

Now I could just raise it, but I suspects there is a resource leak in Nextcloud. Could be in an app, but I do not know how to troubleshoot that.

Steps to replicate it (hint: details matter!):

N/A

Log entries

Nextcloud

Please provide the log entries from your Nextcloud log that are generated during the time of problem (via the Copy raw option from Administration settings->Logging screen or from your nextcloud.log located in your data directory). Feel free to use a pastebin/gist service if necessary.

I see only timeouts of the applications, as well as timeouts towards the richdocuments proxy endpoint.

Due to the errors in regard to Nextcloud office, I disabled both that and the CODE app. However I still noticed the same thing happening.

Web Browser

If the problem is related to the Web interface, open your browser inspector Console and Network tabs while refreshing (reloading) and reproducing the problem. Provide any relevant output/errors here that appear.

PASTE

Web server / Reverse Proxy

The output of your Apache/nginx/system log in /var/log/____:

Nothing other than successfull connections.

Configuration

Nextcloud

The output of occ config:list system or similar is best, but, if not possible, the contents of your config.php file from /path/to/nextcloud is fine (make sure to remove any identifiable information!):

{
    "system": {
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "trusted_proxies": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "cloud.domain.tld",
            "127.0.0.1",
            "xxx.xxx.xxx.xxx",
            "localhost",
            "www.domain.tld"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "pgsql",
        "version": "30.0.4.1",
        "overwrite.cli.url": "https:\/\/cloud.domain.tld",
        "htaccess.RewriteBase": "\/",
        "overwriteprotocol": "https",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "5432",
        "dbtableprefix": "oc_",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "filelocking.enabled": true,
        "memcache.local": "\\OC\\Memcache\\APCu",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "port": 0,
            "timeout": 0
        },
        "ldapProviderFactory": "OCA\\User_LDAP\\LDAPProviderFactory",
        "data-fingerprint": "d5ecd863f85c5c845d61449e95b9cfcb",
        "mail_smtpmode": "sendmail",
        "mail_sendmailmode": "pipe",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "default_phone_region": "DK",
        "maintenance": false,
        "twofactor_enforced": "true",
        "twofactor_enforced_groups": [
            "MFA"
        ],
        "twofactor_enforced_excluded_groups": [
            "NCNoMFA",
            "NoMFA"
        ],
        "share_folder": "\/Delinger",
        "loglevel": 1,
        "app_install_overwrite": [
            "gestion",
            "cas",
            "otpmanager",
            "secrets",
            "cfg_share_links",
            "cms_pico",
            "files_texteditor",
            "side_menu"
        ],
        "theme": "",
        "memories.exiftool": "\/var\/www\/nextcloud\/apps\/memories\/bin-ext\/exiftool-amd64-glibc",
        "memories.vod.path": "\/var\/www\/nextcloud\/apps\/memories\/bin-ext\/go-vod-amd64",
        "maintenance_window_start": 1,
        "memories.db.triggers.fcu": true,
        "allow_local_remote_servers": true,
        "log_type": "syslog"
    }
}

Apps

The output of occ app:list (if possible).

Enabled:
  - activity: 3.0.0
  - admin_audit: 1.20.0
  - announcementcenter: 7.0.1
  - app_api: 4.0.3
  - approval: 2.0.0
  - approve_links: 1.0.2
  - assistant: 2.1.1
  - bruteforcesettings: 3.0.0
  - calendar: 5.0.8
  - call_summary_bot: 2.0.0
  - cas: 0.2.14
  - certificate24: 0.3.5
  - cfg_share_links: 6.1.1
  - checksum: 1.2.5
  - cloud_federation_api: 1.13.0
  - cms_pico: 1.0.21
  - comments: 1.20.1
  - contacts: 6.1.2
  - contactsinteraction: 1.11.0
  - dashboard: 7.10.0
  - dav: 1.31.1
  - dicomviewer: 2.3.0
  - end_to_end_encryption: 1.16.1
  - event_update_notification: 2.5.0
  - external: 5.5.2
  - federatedfilesharing: 1.20.0
  - federation: 1.20.0
  - files: 2.2.0
  - files_accesscontrol: 1.20.1
  - files_automatedtagging: 1.20.0
  - files_downloadlimit: 3.0.0
  - files_notify_redis: 0.3.4
  - files_pdfviewer: 3.0.0
  - files_reminders: 1.3.0
  - files_sharing: 1.22.0
  - files_texteditor: 2.15.1
  - files_trashbin: 1.20.1
  - files_versions: 1.23.0
  - files_zip: 2.1.0
  - flow_notifications: 1.10.0
  - guests: 4.0.1
  - integration_openai: 3.2.0
  - larpingapp: 0.1.20
  - lookup_server_connector: 1.18.0
  - memegen: 1.1.0
  - nextcloud_announcements: 2.0.0
  - notifications: 3.0.0
  - oauth2: 1.18.1
  - oidc: 1.2.0
  - otpmanager: 0.5.4
  - password_policy: 2.0.0
  - photos: 3.0.2
  - privacy: 2.0.0
  - provisioning_api: 1.20.0
  - recommendations: 3.0.0
  - related_resources: 1.5.0
  - richdocuments: 8.5.3
  - richdocumentscode: 24.4.1002
  - root_cache_cleaner: 0.1.8
  - secrets: 2.1.1
  - serverinfo: 2.0.0
  - settings: 1.13.0
  - sharebymail: 1.20.0
  - side_menu: 4.0.1
  - sketch_picker: 2.0.0
  - spreed: 20.1.1
  - support: 2.0.0
  - survey_client: 2.0.0
  - suspicious_login: 8.0.0
  - systemtags: 1.20.0
  - tasks: 0.16.1
  - text: 4.1.0
  - text_templates: 1.1.0
  - theming: 2.5.0
  - twofactor_backupcodes: 1.19.0
  - twofactor_nextcloud_notification: 4.0.0
  - twofactor_totp: 12.0.0-dev
  - twofactor_webauthn: 2.0.0
  - updatenotification: 1.20.0
  - user_ldap: 1.21.0
  - user_status: 1.10.0
  - users_picker: 1.0.0
  - viewer: 3.0.0
  - weather_status: 1.10.0
  - webhook_listeners: 1.1.0-dev
  - workflowengine: 2.12.0
Disabled:
  - circles: 30.0.0 (installed 28.0.0-dev)
  - collectives: 2.15.2 (installed 2.15.2)
  - deck: 1.14.2 (installed 1.14.2)
  - encryption: 2.18.0
  - externalportal: 1.3.1 (installed 1.3.1)
  - files_external: 1.22.0
  - files_mindmap: 0.0.30 (installed 0.0.30)
  - files_scripts: 4.1.0 (installed 4.1.0)
  - firstrunwizard: 3.0.0 (installed 2.16.0)
  - forms: 4.3.4 (installed 4.3.4)
  - gestion: 2.6.3 (installed 2.6.3)
  - gptfreeprompt: 1.0.2 (installed 1.0.2)
  - holiday_calendars: 0.3.0 (installed 0.3.0)
  - impersonate: 1.17.0 (installed 1.17.0)
  - logreader: 3.0.0 (installed 3.0.0)
  - mailnotifier: 0.0.3 (installed 0.0.3)
  - memories: 7.4.1 (installed 7.4.1)
  - notify_push: 0.7.0 (installed 0.7.0)
  - passwords: 2024.12.21 (installed 2024.12.21)
  - sharerenamer: 3.4.0 (installed 3.4.0)
  - stepupauth: 0.2.1 (installed 0.2.1)
  - transfer: 0.6.3 (installed 0.6.3)
  - uppush: 2.1.2 (installed 2.1.2)
  - user_saml: 6.4.1 (installed 6.4.1)
  - whiteboard: 1.0.4 (installed 1.0.4)

Tips for increasing the likelihood of a response

  • Use the preformatted text formatting option in the editor for all log entries and configuration output.
  • If screenshots are useful, feel free to include them.
    • If possible, also include key error output in text form so it can be searched for.
  • Try to edit log output only minimally (if at all) so that it can be ran through analyzers / formatters by those trying to help you.

I set those numbers to 100 or higher. I got that same message when it was set to 50. I don’t know what this means resource wise. But it runs fine on a i5 3570/16GB ram on Ubuntu 2404.

1 Like

I see. Well I never had to do this before, honostly. I do only have 5GB of ram available for the PHP application of NC on this machine (database is on another host entirely).

Maybe, but I suspect that 40 is probably still too low in general for Nextcloud.

In the official tuning guide a value of 120 is set: Server tuning — Nextcloud latest Administration Manual latest documentation

C. Rieger has even put it at 200 in his guide: Nextcloud Installationsanleitung Apache2 (Hub 9) - Carsten Rieger IT-Services

You might also find this online PHP-FPM process calculator helpful, although it was not made specifically for Nextcloud, and Nextcloud probably needs slightly higher values: PHP-FPM Process Caluculator

Thank you. I will set it much higher then.

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.