Nextcloud version (eg, 20.0.5): 24.0.0.12
Operating system and version (eg, Ubuntu 20.04): Alpine linux
(in LXC container)
Apache or nginx version (eg, Apache 2.4.25): nginx 1.20.2-r2
PHP version (eg, 7.4): php8 8.0.19-r0
The issue you are facing:
WebDAV mounts are so slow it’s practically impossible to use them. Even changing into a mounted directory once mounted takes tens of seconds.
Is this the first time you’ve seen this error? (Y/N): N, but I haven’t had a real need for WebDAV access until now
Steps to replicate it:
- mount share via webdav
mount -t davfs https://HOST/remote.php/dav/files/jose/ mount_point
cd mount_point
- list contents
time ls
- get output:
..
Executed in 51.49 secs fish external
usr time 4.66 millis 1.58 millis 3.08 millis
sys time 0.46 millis 0.46 millis 0.00 millis
No relevant information in the logs. Also a request run via CURL runs several times shower when compared to a similarly sized system.
time curl -u user:pass -X PROPFIND http://HOST/remote.php/dav/files/jose/
..
Executed in 2.88 secs fish external
usr time 0.41 millis 412.00 micros 0.00 millis
sys time 3.28 millis 0.00 micros 3.28 millis
While the query is running I can see PHP-FPM process CPU usage goes up to 100 % for a few seconds. After enabling slow-log:
[20-May-2022 11:44:08] [pool nextcloud] pid 4852
script_filename = /usr/share/webapps/nextcloud/remote.php
[0xb6816c30] password_verify() /usr/share/webapps/nextcloud/lib/private/Security/Hasher.php:153
[0xb6816bc0] verifyHash() /usr/share/webapps/nextcloud/lib/private/Security/Hasher.php:177
[0xb6816b30] verify() /usr/share/webapps/nextcloud/lib/private/User/Database.php:343
[0xb6816a90] checkPassword() /usr/share/webapps/nextcloud/lib/private/User/Manager.php:258
[0xb68169e0] checkPasswordNoLogging() /usr/share/webapps/nextcloud/lib/private/User/Session.php:607
[0xb6816970] loginWithPassword() /usr/share/webapps/nextcloud/lib/private/User/Session.php:355
[0xb6816910] login() /usr/share/webapps/nextcloud/lib/private/User/Session.php:450
[0xb6816830] logClientIn() /usr/share/webapps/nextcloud/apps/dav/lib/Connector/Sabre/Auth.php:129
[0xb68167c0] validateUserPass() /usr/share/webapps/nextcloud/3rdparty/sabre/dav/lib/DAV/Auth/Backend/AbstractBasic.php:103
[0xb6816710] check() /usr/share/webapps/nextcloud/apps/dav/lib/Connector/Sabre/Auth.php:251
[0xb6816650] auth() /usr/share/webapps/nextcloud/apps/dav/lib/Connector/Sabre/Auth.php:154
[0xb68165a0] check() /usr/share/webapps/nextcloud/3rdparty/sabre/dav/lib/DAV/Auth/Plugin.php:180
[0xb68164f0] check() /usr/share/webapps/nextcloud/3rdparty/sabre/dav/lib/DAV/Auth/Plugin.php:135
[0xb6816450] beforeMethod() /usr/share/webapps/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php:89
[0xb6816390] emit() /usr/share/webapps/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php:456
[0xb68162f0] invokeMethod() /usr/share/webapps/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php:253
[0xb6816210] start() /usr/share/webapps/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php:321
[0xb68161e0] exec() /usr/share/webapps/nextcloud/apps/dav/lib/Server.php:352
[0xb6816180] exec() /usr/share/webapps/nextcloud/apps/dav/appinfo/v2/remote.php:35
[0xb6816110] [INCLUDE_OR_EVAL]() /usr/share/webapps/nextcloud/remote.php:166
I’d say it has to do something with the user password validation but I have no idea how to dig in further. Any help is greatly appreciated.
Edit: added KCachegrind output (xdebug
) - not sure if it’ll serve any purpose though