External Storage via WebDAV is very slow

Nextcloud version : 21.0.0
Operating system and version : Debian 10.8
Apache or nginx version : Apache 2.4.38
PHP version (eg, 7.4): PHP 7.3.19

The issue you are facing: Files web interface and WebDAV are extremly slow (15s for 6 folders display…).
The environnement is set to use php-fpm, mariaDB 10.3 with APCu Cache, Redis Locking. OpCache is enabled.
The hardware is a DELL PowerEdge with 24 core and 94G Ram, there is an instance of Dolibarr working perfectly.

Is this the first time you’ve seen this error? (Y/N): Yes

Steps to replicate it:

  1. Log in and go to the file app
  2. Browsing through local storage is ok
  3. Browsing to external storage get ~14s of delay between each folder

The output of your Nextcloud log in Admin > Logging:
Nothing relevant

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

https://pastebin.com/KydX70Z2

The output of your Apache/nginx/system log in /var/log/____:

https://pastebin.com/USYPTBYd

The problem seems to be linked to the external storage acces. The media mounted is a Synology NAS and I’m not having any delays while accessing it directly via a WebDAV interface as RaiDrive. I’ve noticed that the PROPFIND request is extremly slow : Here is a recording of a browsing inside internal storage first and then external storage.

The PROPFIND request take 13 s…

Do you have any ideas how I could improve these performance ?
Please feel free to ask me for more details or logs, I’ve been trying a lot of things without real success and I’m getting a bit desperate…
Thanks !

My bad… Xdebug was still on… Turning it off made me gain seconds of course…
And I switched to a NFS mount and a Local external Storage. Launched a file:scan witch occ and solved entirely the problem !

Hope it might help someone else !