Hello everyone,
I have a problem on my nextcloud with truenas and nginx.
I explain myself:
When I try to sync big directories (from my pc or from my android device), i got a problem. Nextcloud starts to slow down and then crash. When it crashes, if I try to connect to nextcloud (even on web interface and even if I wait like an hour), nextcloud either takes very long or fails to access.
If I want it to work again, I have to restart the jail directly on truenas, and it is ok again.
Config : 32Gb of Ram with an i3 10105 on a truenas 13.1 server.
Nextcloud version is 25.0.2.3
Nextcloud client version on my computer is 3.6.4
Here is my nextcloud config :
<?php
$CONFIG = array (
'apps_paths' =>
array (
0 =>
array (
'path' => '/usr/local/www/nextcloud/apps',
'url' => '/apps',
'writable' => true,
),
1 =>
array (
'path' => '/usr/local/www/nextcloud/apps-pkg',
'url' => '/apps-pkg',
'writable' => false,
),
),
'logfile' => '/var/log/nextcloud/nextcloud.log',
'memcache.local' => '\\OC\\Memcache\\APCu',
'one-click-instance' => true,
'one-click-instance.user-limit' => 100,
'memcache.distributed' => '\\OC\\Memcache\\Redis',
'memcache.locking' => '\\OC\\Memcache\\Redis',
'redis' =>
array (
'host' => 'localhost',
),
'passwordsalt' => 'example',
'secret' => 'example',
'trusted_domains' =>
array (
0 => 'localhost',
1 => '192.168.1.X',
2 => '192.168.1.X',
3 => 'nextcloud.example.com'
),
'trusted_proxies' =>
array (
0 => '192.168.1.X', #my nginx IP
),
'datadirectory' => '/usr/local/www/nextcloud/data',
'dbtype' => 'mysql',
'version' => '25.0.2.3',
'dbname' => 'nextcloud',
'dbhost' => 'localhost',
'dbport' => '',
'dbtableprefix' => 'oc_',
'mysql.utf8mb4' => true,
'dbuser' => 'oc_ncadmin',
'dbpassword' => 'password',
'installed' => true,
'instanceid' => 'occ57bkor5zk',
'overwriteprotocol' => 'https',
'overwrite.cli.url' => 'https://nextcloud.example.com',
'overwritehost' => 'nextcloud.example.com',
'overwritewebroot' => '/',
'htaccess.RewriteBase' => '/',
'chunkSize' => '5120MB',
'bulkupload.enabled' => false,
);
I tried a few things but I don’t know what to try next, do you have any ideas?
There is nothing in nextcloud logs that can indicates an error, and nginx indicates “upstream prematurely closed connection”, but I don’t think the problem come from nginx as I need to restart nextcloud to make it work again.
Edit : I worked a bit on it and saw that plex as no slow down at all, it definitely doesn’t come from nginx reverse proxy.
Edit 2 : I monitored ressources of nextcloud’s jail during upload, the biggest cpu usage is mysql which takes around 15% of the cpu usage, it looks normal to me. But when it begins to slow down, sometimes mysql comes to 0-1% cpu usage, and than goes back to 15%. When it crashes, it stay at 0-1% and there is almost no cpu usage. I really struggle with this.
Thanks!