Configuration nextcloud/php-fpm : pm.max_children

Bonjour Yunohost,

J’utilise beaucoup yunohost pour une asso (et une autre instance personnelle) et d’abord bravo pour le boulot et la qualité de l’ensemble !.

J’ai constaté un souci de synchronisation client nextcloud depuis la dernière mise à jour vers YNH 3.7/Nextcloud 18.0.2

Mon serveur

Il s’agit d’un VPS OVH 1core/2go/20Go installé depuis 2017 sous debian 9 et dont les versions ont été mises à jour très régulièrement.

Il est configuré avec Nextcloud/Roundcube/Mailman/Jirafeau/OpenSondage et on y accède en SSH et/ou par la webadmin.

Il n’y a pas de contexte particulier en dehors de quelques outils complémentaires (vim, lnav…). La configuration est la plus standard possible.

    {
        "host": "Debian 9.12",
        "kernel": "4.9.0-12-amd64",
        "packages": {
            "yunohost": {
                "repo": "stable",
                "version": "3.7.1"
            },
            "yunohost-admin": {
                "repo": "stable",
                "version": "3.7.1.1"
            },
            "moulinette": {
                "repo": "stable",
                "version": "3.7.1"
            },
            "ssowat": {
                "repo": "stable",
                "version": "3.7.1"
            }
        },
        "backports": [],
        "system": {
            "disks": {
                "sda1": "Mounted on /, 19.7GiB (6.4GiB free)"
            },
            "memory": {
                "ram": "1.9GiB (1021.1MiB free)",
                "swap": "0B (0B free)"
            }
        },
        "nginx": [
            "nginx: the configuration file /etc/nginx/nginx.conf syntax is ok",
            "nginx: configuration file /etc/nginx/nginx.conf test is successful"
        ],
        "services": {
            "php7.3-fpm": "running (enabled)",
            "glances": "running (enabled)",
            "nslcd": "running (enabled)",
            "metronome": "running (enabled)",
            "slapd": "running (enabled)",
            "postfix": "exited (enabled)",
            "rspamd": "running (enabled)",
            "yunohost-firewall": "exited (enabled)",
            "dovecot": "running (enabled)",
            "nginx": "running (enabled)",
            "php7.0-fpm": "running (enabled)",
            "dnsmasq": "running (enabled)",
            "ssh": "running (enabled)",
            "yunohost-api": "running (enabled)",
            "mysql": "running (enabled)",
            "avahi-daemon": "running (enabled)",
            "shellinabox": "running (enabled)",
            "redis-server": "running (enabled)",
            "uwsgi": "exited (enabled)",
            "fail2ban": "running (enabled)"
        },
        "applications": {
            "agendav": "AgenDAV",
            "mailman": "Mailman",
            "unattended_upgrades": "Unattended-upgrades",
            "jirafeau": "Jirafeau",
            "zerobin": "Zerobin",
            "rainloop": "Rainloop",
            "roundcube": "Roundcube",
            "shellinabox": "Shell In A Box",
            "opensondage": "OpenSondage",
            "baikal": "Baikal",
            "nextcloud": "Nextcloud"
        },
        "security": {
            "CVE-2017-5754": {
                "name": "meltdown",
                "vulnerable": false
            }
        }
    }

Le problème

Très régulièrement depuis la mise à jour, les clients de synchronisation passent en mode déconnecté. J’ai deux domaines avec un peu moins de 10 clients, dont 5 connectés en permanence.

Un contact https aboutit à un erreur 502.

En allant fouiller dans les logs, j’ai fini par trouver 2 erreurs :

    connect() to unix:/var/run/php/php7.3-fpm-nextcloud.sock failed (11: Resource temporarily unavailable) while  connecting to upstream,

Répétés à profusion.

et dans un autre

 WARNING: [pool nextcloud] server reached pm.max_children setting (4), consider raising it

j’ai donc augmenté la valeur de pm.max_children dans le pool nextcloud à 16, mais j’ai de nouveau des erreurs

    WARNING: [pool nextcloud] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 32 children, there are 0 idle, and 11 total children

Quelle est la bonne configuration du pool php pour nextcloud ? Je n’ai pas trouvé d’indices dans la doc nextcloud, et pas non plus sur les forums…

Merci pour l’aide !

Before that upgrade, php was configured with 10 max_children.
However, it may be a lot for only one core.

Since the upgrade, the php config is set according to the capacity of your server.
With a maximum of 4 max_children per core.

Considering your usage, you may considering raising a little your max_children, maybe 8 and turn pm to static.
But, the next upgrade will override the file.

You can have a look to https://yourdomain.tld/yunohost/admin/#/apps/nextcloud/config-panel to reconfigure your php config.

Thanks for the reply, I lowered max_children to 8 and set pm to static.

We’ll see if it goes well.

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