Why is my Nextcloud frontend so slow?

For me the default use of the build-incode Collabora Online Development Edition turns out to be the reason. Tested the docker-compose on different hardware. Slow like hell. Unuseable.

After changing the Collabora Online settings to Use a Demo Server my system is as quick as a direct installation.

Next is to use a Collabora Online instance in my docker-compose.

2 Likes

Sup? I’m new to here. I’m HyunSoo Tony Lee from south korea.

Yesterday, I have tried the next cloud container on my ubuntu vm.
It was too slow to use it when it was connected via web interface or ip address.
googling doesn’t help at all, and I dig into it. here is the solution I’ve found.

  1. additional port has to be open to localhost, and the port number is 9982
    You know the container environment variables! default is that only port 80 is exposed to localhost port. so you have to add one more, 9982 to localhost:9982
  2. disable the app named “builtin CODE” something.
    login to nextcloud web GUI and click on the circled icon on the top right corner and click ‘app’ and find the name CODE something, then ‘disable’ it.

BTW, trusted_domains at the config/config.php is to be modified, so that you can access it remotely.
You may need vi editor, so you have to apt-get update then apt-get install vim first. the IP address or the range at config.php is not the remote client’s ip address or range, it is supposed to be the local ip or ip range where the nextcloud container is running. lookup the interfaces with the command like ifconfig at the container and the container hosting machine.
below is my example. edit it and restart the container.
’trusted_domains’ ==>
array (
‘localhost’,
‘172.17.0.’,
‘192.168.0.

‘127.0.0.*’,
),

that’s it. it should work as it is supposed to be.

It might help to disable collabora: Nextcloud 20.0.2snap2 Interface Incredibly Slow

(as pointed out earlier by @Marcus_Schurstedt)

when you mount the volume (im assuming you have nginx separate from your nextcloud src)
you must use :z for your nginx container as well as your nextcloud service

    nginx:
        image: nginx:stable
        ports:
        - 9001:80
        volumes:
        - ./nginx.conf:/etc/nginx/conf.d/default.conf:ro
        - ./nextcloud:/var/www/html:z

Hi everyone,

just wanted to report back after a while.

Meanwhile i have migrated all of my infrastructure to a proxmox server. That means, that my Nextcloud is running now within a LXC container. And guess what? It runs lightning fast! Now, it is really fun to work with it on a daily base (like checking mails via rainloop).
First i changed my old server (Fujitsu Desktop PC) to run with proxmox. After some time i decided to build an entire new server based on a Ryzen 3 3100 and an ITX Mainboard. The main reason for upgrading my server was to have more RAM (now i have 64GB :blush:).
But as i have now more processing power i also use it for other Tasks like ripping and recoding my BluRay collection.

Cheers

2 Likes

I share your pain … :roll_eyes:

Nextcloud and Docker just does not seem to gel. What a shame.

1 Like

I had a similar problem after moving to a containerized (fpm+nginx version in a podman pod with mariadb, redis and collabora) version of Nextcloud and some Google-foo landed me here which wasn’t really helping my case at all. Frankly most of the info here is a bit misleading. For example why would you need port 9982 exposed?

Anywho, for those who have long load times and find this thread I strongly suggest checking your loglevel settings in your config.php. If set to 0 you’re basically DDoS-ing yourself. Another thing you could check is your Mariadb config. This might help you getting a better performance out of you db: Nextcloud 21 mit Apache2 (http/2) und PHP-FPM (fast track) – Carsten Rieger IT-Services

6 Likes

@apinter
Thank you - forgot my loglevel at 0 and was wondering why my nextcloud is pretty slow, your hint pointed in the right direction now it works smoothly with nginx :slight_smile:

setted to 1. and now it’s fast.

@apinter
I strongly suggest checking your loglevel settings in your config.php . If set to 0 you’re basically DDoS-ing yourself.

+1 for this solution, it worked! I set my loglevel to 2 and it’s much faster now. Thank you for that! :smiley: :+1:

Hi @mfreudenberg! Thanks for your investigation and solution suggestions. It helped me solve my slow loading problem. In my case disabling External storage support helped a lot! I have some SMB and local (USB drive) devices and now I will to enable it back and debug this problem. Cheers!

Sorry people, I have tried everything I found on this forum:

  1. Setting loglevel to 1, 2
  2. Disabling File access control (it was not even installed on my instance)
  3. Disabling External storage

None of the points above helped. My instance is very slow, not only via the WEB interface, but especially when I access it via Android/iPhone apps.

  1. Nextcloud Talk takes up to 15 seconds to load, and this is what I see every time I launch the app:
    Image: Nextcloud

  2. I sync my notes (I use Joplin Notes) via WebDAV, it takes up to 25 secs to establish connection before it starts syncing notes.

  3. Nextcloud App also takes time to refresh itself.

Interesting part is: it takes a long time to establish connection (even log in), and when it is connected once (Talk, Joplin Notes, etc.), it seems to work just fine and fast enough. As soon as I close apps/connection, it takes a while to reestablish that connection.

CPU usage is 20/30% when I use Nextcloud.

My server is fast enough, and I host a few websites, forum and video streaming on it. Everything else is superfast.

       _,met$$$$$gg.          *******@*******
    ,g$$$$$$$$$$$$$$$P.       ---------------------- 
  ,g$$P"     """Y$$.".        OS: Debian GNU/Linux 11 (bullseye) x86_64 
 ,$$P'              `$$$.     Host: KVM/QEMU (Standard PC (i440FX + PIIX, 1996) pc-i440fx-5.2) 
',$$P       ,ggs.     `$$b:   Kernel: 5.10.0-13-amd64 
`d$$'     ,$P"'   .    $$$    Uptime: 13 mins 
 $$P      d$'     ,    $$P    Packages: 667 (dpkg) 
 $$:      $$.   -    ,d$$'    Shell: bash 5.1.4 
 $$;      Y$b._   _,d$P'      Terminal: /dev/pts/0 
 Y$$.    `.`"Y$$$$P"'         CPU: AMD EPYC 7282 (4) @ 2.794GHz 
 `$$b      "-.__              GPU: 00:02.0 VMware SVGA II Adapter 
  `Y$$                        Memory: 514MiB / 7956MiB 
   `Y$$.
     `$$b.                                            
       `Y$$b.                                         
          `"Y$b._
              `"""

I had the same error “slow nextcloud frontend in a docker container”.

As I learned, Docker uses the iptables rules and caused me a server response time of over 3 seconds (in Chrome open the developer tools > network and for each request the “waiting for server response” was over 3 seconds).
Depending on the page in the Nextcloud, a request is made several times and then it quickly multiplies into the double-digit second range.

But now to the solution that helped me:
in the “/etc/systemd/system/multi-user.target.wants/docker.service” file after the “containerd.sock” append “–iptables=false” to disable the iptables function in Docker, then don’t forget “systemctl daemon-reload” and either restart the docker service “systemctl restart docker.service” or reboot the whole server.

Then my response times were like on a bare metal server around 1 second.

I hope this can help one or the other.

Thank you, it works for me.
There is only one mistake -iptables=false should be specified with two dashes --iptables=false