Limit the number of folders loaded in the web interface

I have a folder that contains over 2,800 folders. When I enter the root folder it takes more than 30 seconds to load and show the 2,800 folders and this is a problem for users. Is there a way for me to limit loading to 50 folders, for example, and if I scroll down the page I can load the rest?

Google Drive works this way, it doesn’t load all the folders, a quantity is loaded and as you scroll down the page it loads the others automatically. This way you don’t have to load all the folders at first, it becomes much faster.

Every help is welcome!

Which Nextcloud version are you using? It has become much faster with Nextcloud 28 and Vue. You may also be able to customise the directory structure. But there is probably no solution. Maybe check the issues or write an issue here.

1 Like

This is how it has normally been handled since Nextcloud 28. Only the visible entries + 3 above and below are loaded.
However, only for the fileview of logged in users. If you have shared a directory, then the old mechanism is still in use.
Have you looked in the network tab in your browser’s dev tools to see what, which elements taking so long to load?


Boa sorte,
ernolf

1 Like

Nextcloud version: 29.0.1

Even though it is in an updated version, it still takes time to load the folders…

It is a folder with another 2800 subfolders, totaling more than 1.6TB. Is there any way to improve loading speed or limit the number of folders to be loaded?

That! I have all the directories under the admin user but I shared them with 12 other office users.

It seems to be this request, but I’m not sure, my knowledge on this part is a little limited, sorry

You urgently need to rethink the data structure and organization of your cloud. It would be better to move the files that need to be used by so many people into group folders and add those who need access to them to the group. Then the folders and files will be shown in the much more performant file view of a logged in user who has lazy loading.


ernolf

I still don’t understand correctly what I should do, maybe I expressed myself badly in some parts.

I will provide a step-by-step guide to the structure of my directories and how I shared them, I hope you can help me

Thank you in advance for your understanding

The following screenshot is the user and group structure. Disregard BR Admin, it is only used for Work Flow logic:

Root folder share:

“Servicos BR” is the folder that has 2800 subfolders. The loading delay is when I enter it:

The idea of ​​sharing is to centralize the saving of data in the Admin user to facilitate my backup. However, users in the BR Users group need access to all of these folders and subfolders, understand?

If you have any questions, feel free!

Complementing: The “Servicos BR” folder is where customers are saved, so it would not be viable to separate these folders, for example… It would cause a lot of inconvenience when looking for a certain customer.

Even if it doesn’t solve your problem in the first step, take a look at the Group folders app. This is the actual way to create structures for groups of people as an administrator. Please watch this video. However, I think that you should further divide your folders from the current 2800 folders hierarchically. Whether in different group folders and a subfolder is a different question.

1 Like

Perhaps an intermediate set of sub-folders by the letter the customer names start with?

Yes, I thought about that, that would be the last possible “solution”. But even if I divide the clients by A-Z, there will still be folders with more than 200 subfolders, and loading will continue to be slow.

Of course, there will be a significant improvement, but it still won’t have the speed I wanted…

Can you give us a few more details about your environment? 200 sub-folders isn’t all that large. I wouldn’t expect a noticeable performance problem, but admittedly I haven’t tested performance much lately.

Are these folders all just located on a local drive on this server within the configured datadirectory? Or is S3 involved? Any external Storage involved?

Might be helpful to also share your general config (i.e. occ config:list system or equivalent).

The files are stored on the server’s own hard drive. I will provide you with my docker compose and other settings, I hope it helps you!

services:
  cron:
    image: nextcloud:latest
    restart: always
    volumes:
      - /srv/dev-disk-by-uuid-4d956ca1-ebeb-43bf-9563-6b4bb934082f/BR-DADOS/Aplications/Nextcloud/app:/var/www/html
    entrypoint: /cron.sh
    depends_on:
      - db
      - app
  db:
    image: mariadb:10.6
    restart: always
    command: --transaction-isolation=READ-COMMITTED --log-bin=binlog --binlog-format=ROW
    volumes:
      - /srv/dev-disk-by-uuid-4d956ca1-ebeb-43bf-9563-6b4bb934082f/BR-DADOS/Aplications/Nextcloud/db:/var/lib/mysql
    environment:
      - MYSQL_ROOT_PASSWORD=xxxx
      - MYSQL_PASSWORD=xxxx
      - MYSQL_DATABASE=xxxx
      - MYSQL_USER=xxxx

  app:
    image: nextcloud:latest
    restart: always
    ports:
      - 8080:80
    links:
      - db
    volumes:
      - /srv/dev-disk-by-uuid-4d956ca1-ebeb-43bf-9563-6b4bb934082f/BR-DADOS/Aplications/Nextcloud/app:/var/www/html
    environment:
      - MYSQL_PASSWORD=xxxx
      - MYSQL_DATABASE=xxxx
      - MYSQL_USER=xxxx
      - MYSQL_HOST=xxxx

occ config:list system:

{
    "system": {
        "htaccess.RewriteBase": "\/",
        "memcache.local": "\\OC\\Memcache\\APCu",
        "apps_paths": [
            {
                "path": "\/var\/www\/html\/apps",
                "url": "\/apps",
                "writable": false
            },
            {
                "path": "\/var\/www\/html\/custom_apps",
                "url": "\/custom_apps",
                "writable": true
            }
        ],
        "upgrade.disable-web": true,
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "xxxx",
            "xxxx"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "mysql",
        "version": "29.0.1.1",
        "overwrite.cli.url": "http:\/\/xxxx",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "mysql.utf8mb4": true,
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "overwriteprotocol": "https",
        "default_phone_region": "BR",
        "enable_previews": true,
        "maintenance": false,
        "loglevel": 0,
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpmode": "smtp",
        "mail_sendmailmode": "smtp",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "defaultapp": "",
        "maintenance_window_start": 1,
        "versions_retention_obligation": "auto,30",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "465",
        "mail_smtpauth": 1,
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***"
    }
}
* Hardware config:

* Linux running in SSD
* Nextcloud aplication and files in HD 8TB (with one more 8TB backup HD)
* Ram 2x8GB DDR4 2400mhz
* Intel i7-8700
* 12 simultaneous users

It is worth noting that all users access nextcloud through a cloudflare tunnel. I don’t know to what extent internet speed influences the loading of folders, maybe you can help me with this question…

If you need any more information just ask

Before we go too far…

Please adjust your loglevel to something reasonable (I suggest 2, which is the default). This impacts performance.

And you should have a Redis container and caching enabled in a production environment such as this: Server tuning — Nextcloud latest Administration Manual latest documentation

Also, bump to the latest maintenance release (you’re several behind), to make sure you’ve got all the latest bug fixes.

Ok, thanks for the tips, I’ll make these changes.

I don’t know about the most recent maintenance, can you tell me where I can find documentation about it?

https://docs.nextcloud.com/server/latest/admin_manual/release_schedule.html#maintenance-releases

1 Like