Why is my Nextcloud frontend so slow?

Your router probably includes a basic firewall, and as long as you close all ports that don’t run public services, that should be good enough for basic protection.

Yeah, I agree. There are also other reasons, like using a device with a useful size and shape (like Raspberry Pi).

I second that. Just to be sure: You mount your data, config and apps via cifs from your NAS over the network? So every request for data has to travel your home network from Nextcloud-machine to NAS? I have no experience with cifs mounts, but could imagine that these can be performance bottlenecks as well, especially if the network is in between (even more so if your desktop server is connected via WiFi) … I’d try putting the machine running Nextcloud next to the NAS serving the data and connect both via ethernet cable and see how that works.

Hi,

so i did a vmstat -S M 1 100 > vmstat.log and in parallel i opened my frontpage with chrome (emptied cache before). As far as i can see, swapping looks good and there is no critical waiting i/o. But the colums in (interrupts) and cs (context switches) looks high. What i read in a serverfault forum is, that context switches are normal.

if your server is running in power saving mode

I search the net i can find anything about that. thanks for the tip.

r b swpd free buff cache si so bi bo in cs us sy id wa st
0 0 2254 1207 54 655 0 0 38 49 11 2 6 3 91 0 0
0 0 2254 1222 54 655 0 0 0 316 1130 2774 2 1 97 0 0
0 0 2254 1223 54 655 0 0 0 48 818 1673 1 1 98 0 0
0 0 2254 1223 54 655 0 0 0 36 784 1572 1 1 99 0 0
0 0 2254 1223 54 655 0 0 0 0 1862 4210 1 2 97 0 0
0 0 2254 1223 54 655 0 0 0 0 3874 9094 5 4 92 0 0
0 0 2254 1220 54 655 0 0 0 0 3166 7171 5 4 91 0 0
1 0 2254 1219 54 655 0 0 8 0 8083 20812 12 11 77 0 0
0 0 2254 1214 54 655 0 0 0 0 8811 22691 10 9 81 0 0
0 0 2254 1206 54 655 0 0 0 36 6775 17573 9 7 85 0 0
0 0 2254 1202 54 655 0 0 0 12 5043 12409 5 6 90 0 0
0 0 2254 1201 54 655 0 0 0 0 8089 21600 10 10 80 0 0
0 0 2254 1203 54 655 0 0 0 0 6384 14844 15 7 77 0 0
4 0 2254 1192 54 655 0 0 8 0 6964 17029 12 7 81 0 0
1 0 2254 1188 54 655 0 0 0 68 5169 11414 12 5 83 0 0
1 0 2254 1179 54 655 0 0 0 0 5753 10679 15 6 79 0 0
0 0 2254 1174 54 655 0 0 12 0 7443 14280 14 6 79 1 0
1 1 2254 1166 54 652 0 0 0 28 7241 16535 20 9 71 0 0
1 0 2254 1169 54 655 0 0 0 0 9515 17480 30 11 57 1 0
0 0 2254 1171 54 655 0 0 0 2104 6925 16149 8 6 85 0 0
0 0 2254 1171 54 655 0 0 0 12 7475 19194 7 7 87 0 0
7 0 2254 1102 54 655 0 0 76 0 7186 18565 15 8 76 0 0
6 0 2254 1103 54 655 0 0 4 0 6298 15608 37 9 54 0 0
8 0 2254 1164 54 655 0 0 20 408 6617 17190 11 8 81 1 0
1 0 2254 1164 54 655 0 0 8 188 6781 16646 10 7 83 0 0
1 0 2254 1165 54 655 0 0 64 268 4863 11860 9 5 85 1 0
0 0 2254 1183 54 655 0 0 0 0 1765 3673 1 2 97 0 0
0 0 2254 1183 54 655 0 0 0 0 3142 6643 3 3 94 0 0
2 0 2254 1189 54 655 0 0 0 0 1692 4071 7 7 85 0 0
1 0 2254 1201 54 655 0 0 0 280 989 1941 3 2 95 0 0

I’d try putting the machine running Nextcloud next to the NAS serving the data and connect both via ethernet cable and see how that works.

They are connected via Gigabit-LAN. There is only one switch in between.

This is the iperf result when running from server -> NAS

------------------------------------------------------------
Client connecting to 192.168.1.200, TCP port 4999
TCP window size: 85.0 KByte (default)
------------------------------------------------------------
[  3] local 192.168.1.201 port 35536 connected with 192.168.1.200 port 4999
[ ID] Interval       Transfer     Bandwidth
[  3]  0.0-10.0 sec  1.09 GBytes   940 Mbits/sec

just one further remark. I was able to deploy my test-instance on a single node docker swarm and so far it is working - i am able to access the frontpage and login. Will make further tests and report back.

I don’t know how to read vmstat and you should be looking inside the VM anyway for this information as the host is not the same thing as the guest.

Context switching is not a good sign either. Context switching is an expensive operation.

Anywho, good luck with this. I would personally trash the entire thing and start from scratch on baremetal or a base installation on KVM/LXC.

I’m getting a headache and pain in the guts when i hear/read baremetal. But when this is my last Option, well sure i would try it again.

I don’t know about KVM/LXC. Are these commercial VM-Solutions? Can i make a host-redundant solution with that?

In case of baremetal, what specs (CPU, RAM) would you recommend for a 5-10 user soho installation, if i want to have load page times between 1-2 s?

Dunno there is no official documentation on this.

I was hoping you could tell from your experience ;-). But maybe that’s a separate thread.

No every installation is different and I certainly haven’t tested low end hardware.

I pushed the memory limit to 1024 on my test instance, but the lowest loading time was around 12s.

After i fiddled around a bit with my browser settings i disabled adblock, privacy badger and the firefox integrated tracking protection for that site. After that changes i was down to ~6s.

Afterwards i disabled all apps, and had a load time of 1.5-2s ! Bingo!

Now, slowly enabling back one app after another i was able to identify some apps, that add a few seconds to the loading time:

  • federation: around 1.5s (irregardless of the app loaded)

Interestingly disabling the following apps made the loading slower (???)

  • Accessibility (~1s)

In summary i disabled the following apps, which i don’t really use and thus reduced the mean loading time from 12s to 4.5s, which is ok for me:

  • Announcement center
  • Federation
  • First run wizard
  • News
  • Nextcloud announcements
  • Phone Sync
  • Privacy
  • Recommendations
  • Social
  • Update notification
  • Usage survey

I’m leaving the memory_limit at the standard value of 512MB as i don’t see a benefit of increasing it.

Thanks a lot for your hints!

Hello, it’s me again :slight_smile:

just wanted to add my latest update on this topic (partly posted also here Nextcloud really slow after installation):

Meanwhile, i made a “bare-metal” test installation on the same host, where my docker container are running. And the bare-metal nextcloud-instance feels lightning fast - sometimes the load times are below 1s. I’m already thinking about moving back to bare-metal or considering the use of VM’s like proxmox. But somehow i still don’t want to give up docker, because i really like the concept.

Hi I know this is an old post but I have NextCloud running on a very low-end Synology NAS although it is slow it’s not too slow for my purposes, wanted to let you know I sovled some performace issues recently I had LDAP running, I disabled this and it’s like night and day, perhaps test this as well

Just my thoughts

1 Like

External S3 access can also make access to Files app very slow when it is set to update every time. In the setting of the s3 integration you can turn that off. It shaved 3-4 seconds off my response time with Files. It is now responding under 1.5 seconds almost consistently (with Redis).

God. I see too much of @Paradox551 type’s that assume we’re morons and need 24/7 “support” from them… our saviours. :anger:

2 Likes

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

I share your pain … :roll_eyes:

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