SOLVED Nextcloud keeps crashing

gorrunyo

Dabbler
Joined
Sep 12, 2022
Messages
17
Hi,

I have a very small TrueNAS Scale (recently migrated to bluefin) running some services (NextCloud, Plex, Photoprism, Gitea).
In general, it seems to be working fine, but quite often, Nextcloud crashes. Sometimes when opening a document, in ONLYOFFICE, and sometimes, when entering a folder. I have even seen it happening when the iOS application uploads photos.

I just did a fresh installation of Nextcloud, but the problem persists, and the log from the pod application shows this message:

Code:
[05-Feb-2023 15:35:01] WARNING: [pool www] server reached pm.max_children setting (5), consider raising it
[05-Feb-2023 15:35:54] NOTICE: Finishing ...
[05-Feb-2023 15:35:54] NOTICE: exiting, bye-bye!


The message is quite explicit, and probably looking for the proper configuration file I can try to fix it, but this is a minimal, home installation with no stress, and I fear the original problem might be somewhere else and perhaps kite obvious.

Any advice will be appreciated.
Cheers
 

browntiger

Explorer
Joined
Oct 18, 2022
Messages
58
That is nginx, all depends if you are using some ingress like Traefik or some other...
 

gorrunyo

Dabbler
Joined
Sep 12, 2022
Messages
17
Thanks for the reply,

Everything has been installed using @truecharts helm charts, and Traefik is the Ingress handler.
 
Last edited:

browntiger

Explorer
Joined
Oct 18, 2022
Messages
58
Odd, mine runs just fine. Do you have enough memory?


But sure, try to adjust
open shell to pod: nextcloud-xxx-lphbm
cd /usr/local/etc/php-fpm.d
the setting is in www.conf (no vi, so use nano)
pm.max_children = 8

(1) See if this will fix the issue in the first place
(2) It will not be persistent, so you need to decide how your nextcloud will be updated in the future.
 

gorrunyo

Dabbler
Joined
Sep 12, 2022
Messages
17
Odd indeed.

My system has 64GB of memory and currently uses only half of it.
PHP_MEMORY_LIMIT is set at its default (4G).


I did try to change the pm.max_children in www.conf, but it doesn't take effect as I would imagine that php-fpm service needs to be restarted, which I don't know how to do without restarting nextcloud service and lose the configuration changes.

There must be something else that is inducing this problem in the Nextcloud execution.
 

gorrunyo

Dabbler
Joined
Sep 12, 2022
Messages
17
I've tried this (insane but effective ) hack, and now NC seems to be stable.

Apparently, this is a known problem discussed in discord, and an upstream PR is still open to configure this with an environment variable.
 
Joined
Apr 2, 2023
Messages
1
I've tried this (insane but effective ) hack, and now NC seems to be stable.

Apparently, this is a known problem discussed in discord, and an upstream PR is still open to configure this with an environment variable.
Hi, could you share what the hack is? Discord is not a good way to keep track of any tech support information (can't search it, and probably will have broken links like this one).
Thanks.
 

gorrunyo

Dabbler
Joined
Sep 12, 2022
Messages
17
By: alomsimoy#7290

Hello! I've been working on a workaround to the PHP_MEMORY_LIMIY for max_children problem, and I found a pretty simple solution that I wanted to share: Put the attached file somewhere in your server. That file is just a copy of the www.conf file generated in nextcloud with the max_children values changed for 8GB of memory. You can change whatever value you feel there. Here is a good calculator for those values: https://spot13.com/pmcalculator/ Then just mount the file with an additional app storage in your nextcloud instance like in the image attached. Just point to where you have the file in the Host Path. After that you'll have the problem solved until a proper solution is worked out
da3651e59d6006dfa5fa07ec3102d1f3.svg
I hope it helps. Cheers!

image.png
 
Top