SMB Mount very slow



In our company we have one big “public” folder where everyone has access (with some restrictions). It is ~400Gb worth of data. Obviously this is not ok, so I decided to try out nextcloud and organize all this (so each user has it’s own space, and can share files/folders with others etc). At the moment I’m testing it using docker, and I already have configured nextcloud with LDAP (we use it across the company). For the meantime I want the user to continue having access to this Public folder, so I mount it as external smb storage.


The problem is that it gets very slow to list the directories when the user navigates to this folder (like 10-20 secs). I tried check for updates with “Never” and “Once every direct access” without success. Always is slow.


I tried to mount the SMB folder directly to the host system where nextcloud is running, and use that mount as “external local storage” and it is working fast! The problem with this solution is that because I have to mount the smb folder to the host system (so then nextcloud can see it as “local”), user specific permissions are not working anymore (not all users have read/write access to all folder/files in this Public folder).

Just to add that I run nextcloud with a MariaDB and a configured Redis instance. (I also tried without, result is the same).

Any ideas how can I achieve the “same” speed as host mounted but without loosing user permissions? Any help or point to the right direction will be very appreciated.

1 Like


I suppose, I’ve got the same problem.

Nextcloud documentation (see: SMB/CIFS — Nextcloud latest Administration Manual latest documentation) says,
libsmbclient-php should be installed for optimum performance.

Ubuntu 20.04 unfortunately does not provide a ready compiled package for this.
This source GitHub - eduardok/libsmbclient-php: smbclient's extension for PHP should work.

To compile this PECL module in Ubuntu 20.04, you have to install php7.4-dev and libsmbclient-dev.

Thanks for this hint: Extreme CPU load and slow operation with external storage SMB/CIFS · Issue #6865 · nextcloud/server · GitHub