Reply to topic

Speeding up mounted dirs by *not* counting files in subdirs?

heinzarbuckle
Registered Member
Posts
1
Karma
0
Hi all,

I am accessing Samba shares mounted via fstab with Dolphin, and I've noticed that on some directories, Dolphin seems to completely hang for several minutes, while the processor load on my Samba server goes to 99%. Now, perhaps unreasonably, my Samba server is a Raspberry Pi, so of course it's slow, and I want to do a bit to relieve it. I haven't done extensive testing, but the problems seems to arise when a folder I am accessing has subfolders that contain many files (2000 - 20000), and I am in Detail view mode, with the file size column switched on. Presumably, the processor load on the Samba server and the resultant hang of Dolphin take place while it's trying to count all those files in subfolders. Now I *do* want to retain the ability to see the size of the files in the folder I am displaying, but I would like to switch off that unneccesary access to sub-folders. So: is there a way to retain the file size column, but NOT have it display the numbers of files in folders? (Windows Explorer does that, for example. Files sizes are displayed, but for folders that entry is just left blank, ie no "xxx items" entry.)

Cheers,
Heinz
freininghaus
Moderator
Posts
176
Karma
1
OS
This is not possible, sorry. Note that the @Siye@ column is not the only reason why we look at the contents of folders. We also need to know if the folder is not empty to determine if an "expansion toggle" (arrow next to the file name) should be shown in details view.
freininghaus
Moderator
Posts
176
Karma
1
OS
Just for the record, a (probably) similar issue has been reported again: https://bugs.kde.org/show_bug.cgi?id=318518

So I did some investigations in the code (which has not been written by me) and found out that we actually try to find out if a folder is local before we investigate its contents. In other words: no folder content counting should take place for remote folders. It looks like something is going wrong.
wolfi323
Registered Member
Posts
232
Karma
0
OS
freininghaus wrote:So I did some investigations in the code (which has not been written by me) and found out that we actually try to find out if a folder is local before we investigate its contents. In other words: no folder content counting should take place for remote folders. It looks like something is going wrong.

Maybe that is caused by the patch some distributions used to workaround https://bugs.kde.org/show_bug.cgi?id=288824 ?

The bugreport you mentioned is against 4.10.1 which still contained bug#288824.
So I guess Fedora's package contains that patch (see comment #47 there), which changes kfileitem.cpp to always regard nfs and smb as "fast" filesystems...
freininghaus
Moderator
Posts
176
Karma
1
OS
wolfi323 wrote:
freininghaus wrote:Maybe that is caused by the patch some distributions used to workaround https://bugs.kde.org/show_bug.cgi?id=288824 ?


Probably not. That patch is about 'slowness', but the decision whether to count the items inside folders is taken based on whether the folder is 'local', i.e., it is accessed via the 'file:' protocol. Files on a Samba server, which are accessed via 'smb:', should not be considered local if I read the code and the API docs correctly.
wolfi323
Registered Member
Posts
232
Karma
0
OS
freininghaus wrote:
wolfi323 wrote:
freininghaus wrote:Maybe that is caused by the patch some distributions used to workaround https://bugs.kde.org/show_bug.cgi?id=288824 ?


Probably not. That patch is about 'slowness', but the decision whether to count the items inside folders is taken based on whether the folder is 'local', i.e., it is accessed via the 'file:' protocol. Files on a Samba server, which are accessed via 'smb:', should not be considered local if I read the code and the API docs correctly.

Ok, this was just a thought. I didn't look at the source code.

Well, if the share is accessed via 'smb:' the check is working fine here (4.10.2): the size column shows 'unknown'.
But if the share is mounted (like the OP does), the folder contents are counted.

So the difference is, whether 'smb:' is used or the share is mounted (it seems to be considered local then).
User avatar bcooksley
Administrator
Posts
18688
Karma
83
OS
Any share which is mounted into the system is considered to be local, as KDE accesses it (like all other POSIX applications do) through normal file system operations, rather than through specialised protocols such as smb://, nfs://, etc. In this instance, checking for Fast/Slow file systems in the code could help.


System Settings and Device Actions KCM maintainer
Image
freininghaus
Moderator
Posts
176
Karma
1
OS
In Dolphin 4.12, we will count the files inside subfolders of the current directory in another thread. This should at least prevent that the GUI freezes while the counting takes place, see

https://git.reviewboard.kde.org/r/111920/

 
Reply to topic

Bookmarks



Who is online

Registered users: apater, Baidu [Spider], Bing [Bot], Exabot [Bot], Google [Bot], Majestic-12 [Bot], mmistretta, MSNbot Media, onesandzeros, renatoatilio, shmerl, Uri_Herrera, Yahoo [Bot]