Files component is very slow - How to debug the situation?

So i have a nextcloud instance, self hosted, and everything is great.

There is one small issue i have lately and is the fact the the Files component is very slow. So every other component works fine (fast) (deck, notes, etc).

The server is running on a ubuntu 22.04 container, with apache, and mariadb 10.3. Also i using php 8.2 with opcache enabled.

So the thing is that when i first click the files icon, it start to load, and waits for about 10-20 seconds before showing the main interface, with a spining animation at the center. It then waits another 10-15 seconds before all the files show up. After that i can click on a folder and it opens it very fast (1 second maybe).
So what could it be ? Could it be that it build the whole folder structure everytime ? Maybe one of my plugins is to blame ? (Group Folders for example).

I tried everything i found related to tuning, but i think its not actually related to tuning mysql or php.

So what im asking is how could i approach this in order to find out what is actually causing this.
Im thinking maybe something like this:

  • clone the instance
  • start deleting apps
  • remove all the folder shares
  • remove folders

What else ? What do you think ?

start from the OS and dig down deeper into individual components.
have a look what the CPU/Memory/IO is doing (htop/atop)
if it is mysql (possibly), you will see spikes in CPU/mem utilization and/or IO waits.

For mysql, the script was gold to help navigating to optimize innodb and all the buffers.

Having mysqldb on a fast nvme drive made quite a difference too.

Enabling memcache in Nextcloud (APCu/Redis) was another step forward.

Tuning PHP-FPM was another area that improved things massively (OPcache etc).

Same as having database on fast nvme, this is true for the Nextcloud data dir location too.

Splitting workloads on and run them on separate machines (ie. Nextcloud core on one worker/node, Collabora CODE on another worker/node, run database on another worker/node also made difference).

So in nuthsell, I’d start with undestading what’s going on on the system level and follow on from there.

1 Like
  • Check browser console/inspect (Console and Network tabs are typically of the most interest)
  • Check your Nextcloud log

Wild guess: Do you have some old External Storage mounts configured that aren’t working any longer?

1 Like

Hy there.
So i have used, im using ssds, i have memcache and redis, also opcache for php.

So, after some digging it seems that everything goes sideways if i have the File sharing app enabled.

Everything is very fast if it is disabled (related to the files component).

If i enable it, i get the mentioned behaviour.

Ive checked the access logs, and everything seems fine.
I also checked the process list in mysql, and everything is running very fast.

On client side i can see this if i hit F5 on the Files app.
So this is from the network tab in the browser:

Any ideas related to the File Sharing app ? What to look for ? Could it still be related to stuff like the database ?

edit: i think its the same issue described here Slow loading files page on federated shares - :information_source: Support - Nextcloud community