KIO SMB slave performance issue. Any help?

Mark Gaiser markg85 at
Mon May 25 19:32:52 BST 2015


A few days ago i started profiling and debugging the KIO SMB slave to
figure out why a simple task as listing a directory (in dolphin) is so
utterly slow. It's been like that for as long as i remember but never had
attempted to debug it before.

Do this for example:
Mount a samba network share locally like so:
mount -t cifs //path/to/your/share /path/to/your/mount/ -o user=guest,guest

Now if you browse that folder in dolphin (the cifs mount) you get perfectly
fine performance. Listings work rapidly.

If you browse to the exact same location using smb://path/to/your/share
you're welcomed by notably slower performance. I'm not talking about 0.1
second vs 0.2, but rather numbers like ~1 second for cifs and ~5 seconds
for smb://.. You - as a user - will notice that difference.

I know, i can just use cifs and be done with it. But i prefer to have a
good smb slave so i rather investigate this further.

I've tried various things to profile this but i'm stuck.. I did make some
network profiles (using wireshark) to inspect the smb network packets.The
big difference i see there is that smb:// sends an ACK for everything it
receives. CIFS never sends any ACK (that i could find).

I've tried putting valgrind over it with callgrind and that turned up one
weird behavior in listing a folder. Every single file request is being send
through SMBSlave::auth_smbc_get_data which in turn does "if (
!checkCachedAuthentication( info ) )" which is a quite slow call! But
disabling that line (you can find it in kio_smb_auth.cpp line 100) doesn't
speed up directory listing notable. So while that is slow, that is not the
cause nor the fix.

Starting a slave in debug mode and attaching a debugger to it also didn't
tell me anything useful either.

I have no clue how to investigate this issue further. Would anyone
(preferably with knowledge of the SMB slave) be kind enough to provide some
help or pointers where i can find help to tackle this issue?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the kde-core-devel mailing list