Nextcloud super slow and 504 Gateway Time-outs

Hi folks

I have a nextcloud instalation on an OMV 4 distro in docker using letsencrypt and mariadb working for months now without any issues, but for some reason since a week ago my frontend (webpage) is amazingly slow, when I try to access nextcloud.myserver.org, most of the time I just get 504 Gateway Time-out, and the desktop apps sometimes cannot connect to the server, sometimes they do and syncing is very slow.

The problem is not with the server machine or disks, I can access the server disk by samba with 50mb/s transfers without any issues, is just when trying to access the nexcloud server that I have problems.

Please help, I’ve been for a week sweeping online try to find a fix and other then rebuilding the server (somehting that I would like to avoid) I don’t know what else to do.

Nextcloud version (eg, 18.0.2):
Operating system and version (eg, Ubuntu 20.04):
Apache or nginx version (eg, Apache 2.4.25):
PHP version (eg, 7.1):

The issue you are facing:

Is this the first time you’ve seen this error? (Y/N):

Steps to replicate it:

The output of your Nextcloud log in Admin > Logging:

PASTE HERE

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

<?php
$CONFIG = array (
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'datadirectory' => '/data',
  'instanceid' => 'ochtom5qzv5z',
  'passwordsalt' => '***',
  'secret' => '***',
  'trusted_domains' =>
  array (
    0 => 'nextcloud.****.duckdns.org',
  ),
  'dbtype' => 'mysql',
  'version' => '19.0.5.2',
  'overwrite.cli.url' => 'https://nextcloud.***.duckdns.org',
  'dbname' => 'nextcloud',
  'dbhost' => 'mariadb',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'oc_admin',
  'dbpassword' => '****',
  'installed' => true,
  'maintenance' => false,
  'theme' => '',
  'loglevel' => 2,
);

The output of your Let’s encrypt retreived using docker logs letsencryp:

[cont-finish.d] executing container finish scripts...
[cont-finish.d] done.
[s6-finish] waiting for services.
s6-svwait: fatal: supervisor died
[s6-finish] sending all processes the TERM signal.
[s6-finish] sending all processes the KILL signal and exiting.
[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 01-envfile: executing...
[cont-init.d] 01-envfile: exited 0.
[cont-init.d] 10-adduser: executing...
usermod: no changes

-------------------------------------
          _         ()
         | |  ___   _    __
         | | / __| | |  /  \
         | | \__ \ | | | () |
         |_| |___/ |_|  \__/


Brought to you by linuxserver.io
-------------------------------------

To support the app dev(s) visit:
Certbot: https://supporters.eff.org/donate/support-work-on-certbot

To support LSIO projects visit:
https://www.linuxserver.io/donate/
-------------------------------------
GID/UID
-------------------------------------

User uid:    1000
User gid:    100
-------------------------------------

[cont-init.d] 10-adduser: exited 0.
[cont-init.d] 20-config: executing...
[cont-init.d] 20-config: exited 0.
[cont-init.d] 30-keygen: executing...
using keys found in /config/keys
[cont-init.d] 30-keygen: exited 0.
[cont-init.d] 50-config: executing...
Variables set:
PUID=1000
PGID=100
TZ=Europe/London
URL=***.duckdns.org
SUBDOMAINS=wildcard
EXTRA_DOMAINS=
ONLY_SUBDOMAINS=false
VALIDATION=duckdns
DNSPLUGIN=
EMAIL=****
STAGING=

SUBDOMAINS entered, processing
Wildcard cert for ***.duckdns.org will be requested
E-mail address entered: ***@hotmail.com
duckdns validation is selected
the resulting certificate will only cover the subdomains due to a limitation of                                            duckdns, so it is advised to set the root location to use www.subdomain.duckdns.                                           org
Certificate exists; parameters unchanged; starting nginx
Starting 2019/12/30, GeoIP2 databases require personal license key to download.                                            Please retrieve a free license key from MaxMind,
and add a new env variable "MAXMINDDB_LICENSE_KEY", set to your license key.
[cont-init.d] 50-config: exited 0.
[cont-init.d] 60-renew: executing...
The cert does not expire within the next day. Letting the cron script handle the                                            renewal attempts overnight (2:08am).
[cont-init.d] 60-renew: exited 0.
[cont-init.d] 90-config: executing...

******************************************************
******************************************************
*                                                    *
*                                                    *
*          This image has been deprecated            *
*                                                    *
*              Use the new image at                  *
*                                                    *
*                linuxserver/swag                    *
*                                                    *
*    https://hub.docker.com/r/linuxserver/swag       *
*                                                    *
*   https://github.com/linuxserver/docker-swag       *
*                                                    *
*                                                    *
*                                                    *
******************************************************
******************************************************
[cont-init.d] 90-config: exited 0.
[cont-init.d] 99-custom-files: executing...
[custom-init] no custom files found exiting...
[cont-init.d] 99-custom-files: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
nginx: [alert] detected a LuaJIT version which is not OpenResty's; many optimiza                                           tions will be disabled and performance will be compromised (see https://github.c                                           om/openresty/luajit2 for OpenResty's LuaJIT or, even better, consider using the                                            OpenResty releases from https://openresty.org/en/download.html)
Server ready

The output of your Nexcloud log retreived using docker logs nextcloud:


[cont-init.d] executing container initialization scripts...
[cont-init.d] 01-envfile: executing...
[cont-init.d] 01-envfile: exited 0.
[cont-init.d] 10-adduser: executing...
usermod: no changes

-------------------------------------
          _         ()
         | |  ___   _    __
         | | / __| | |  /  \
         | | \__ \ | | | () |
         |_| |___/ |_|  \__/


Brought to you by linuxserver.io
-------------------------------------

To support LSIO projects visit:
https://www.linuxserver.io/donate/
-------------------------------------
GID/UID
-------------------------------------

User uid:    1000
User gid:    100
-------------------------------------

[cont-init.d] 10-adduser: exited 0.
[cont-init.d] 20-config: executing...
[cont-init.d] 20-config: exited 0.
[cont-init.d] 30-keygen: executing...
using keys found in /config/keys
[cont-init.d] 30-keygen: exited 0.
[cont-init.d] 40-config: executing...
[cont-init.d] 40-config: exited 0.
[cont-init.d] 50-install: executing...
[cont-init.d] 50-install: exited 0.
[cont-init.d] 60-memcache: executing...
[cont-init.d] 60-memcache: exited 0.
[cont-init.d] 70-aliases: executing...
[cont-init.d] 70-aliases: exited 1.
[cont-init.d] 99-custom-files: executing...
[custom-init] no custom files found exiting...
[cont-init.d] 99-custom-files: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
Could not open input file: /config/www/nextcloud/cron.php
Could not open input file: /config/www/nextcloud/cron.php
Could not open input file: /config/www/nextcloud/cron.php
Could not open input file: /config/www/nextcloud/cron.php
Could not open input file: /config/www/nextcloud/cron.php
Could not open input file: /config/www/nextcloud/cron.php
Could not open input file: /config/www/nextcloud/cron.php
Could not open input file: /config/www/nextcloud/cron.php
Could not open input file: /config/www/nextcloud/cron.php
Could not open input file: /config/www/nextcloud/cron.php
Could not open input file: /config/www/nextcloud/cron.php
Could not open input file: /config/www/nextcloud/cron.php
Could not open input file: /config/www/nextcloud/cron.php
Could not open input file: /config/www/nextcloud/cron.php
Could not open input file: /config/www/nextcloud/cron.php
Could not open input file: /config/www/nextcloud/cron.php
Could not open input file: /config/www/nextcloud/cron.php
Could not open input file: /config/www/nextcloud/cron.php
Could not open input file: /config/www/nextcloud/cron.php
Could not open input file: /config/www/nextcloud/cron.php
Could not open input file: /config/www/nextcloud/cron.php
Could not open input file: /config/www/nextcloud/cron.php
Could not open input file: /config/www/nextcloud/cron.php
Could not open input file: /config/www/nextcloud/cron.php
Could not open input file: /config/www/nextcloud/cron.php

Did you ever receive a reply or a suggested fix to this issue? I’d be interested in hearing as I’m having the same issue. For me it’s after an upgrade.