Bug 9087 - [PATCH] Disk I/O drain by stating the same files over and over again
: [PATCH] Disk I/O drain by stating the same files over and over again
Status: NEW
Product: Logitech Media Server
Classification: Unclassified
Component: Artwork
: 7.4.0
: PC Other
: P5 normal (vote)
: 8.0.0
Assigned To: Andy Grundman
: patch_waiting
Depends on: 9919
Blocks:
  Show dependency treegraph
 
Reported: 2008-08-09 09:05 UTC by J. Nick Koston
Modified: 2012-03-20 08:11 UTC (History)
1 user (show)

See Also:
Category: ---


Attachments
cache stats (587 bytes, patch)
2008-08-10 14:56 UTC, J. Nick Koston
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description J. Nick Koston 2008-08-09 09:05:46 UTC
This patch reduces the number of stats by caching the results when you are looking at lots of files in the same dir.

stat("/stor/content/My Music/LOCAL/__ARTIST__/", {st_mode=S_IFDIR|0777, st_size=4096, ...}) = 0
stat("/stor/content/My Music/LOCAL/__ARTIST__/cover.png", 0x915d140) = -1 ENOENT (No such file or directory)
stat("/stor/content/My Music/LOCAL/__ARTIST__/cover.jpg", 0x915d140) = -1 ENOENT (No such file or directory)
stat("/stor/content/My Music/LOCAL/__ARTIST__/cover.jpeg", 0x915d140) = -1 ENOENT (No such file or directory)
stat("/stor/content/My Music/LOCAL/__ARTIST__/cover.gif", 0x915d140) = -1 ENOENT (No such file or directory)
stat("/stor/content/My Music/LOCAL/__ARTIST__/Cover.png", 0x915d140) = -1 ENOENT (No such file or directory)
stat("/stor/content/My Music/LOCAL/__ARTIST__/Cover.jpg", 0x915d140) = -1 ENOENT (No such file or directory)
stat("/stor/content/My Music/LOCAL/__ARTIST__/Cover.jpeg", 0x915d140) = -1 ENOENT (No such file or directory)
stat("/stor/content/My Music/LOCAL/__ARTIST__/Cover.gif", 0x915d140) = -1 ENOENT (No such file or directory)
stat("/stor/content/My Music/LOCAL/__ARTIST__/thumb.png", 0x915d140) = -1 ENOENT (No such file or directory)
stat("/stor/content/My Music/LOCAL/__ARTIST__/thumb.jpg", 0x915d140) = -1 ENOENT (No such file or directory)
stat("/stor/content/My Music/LOCAL/__ARTIST__/thumb.jpeg", 0x915d140) = -1 ENOENT (No such file or directory)
stat("/stor/content/My Music/LOCAL/__ARTIST__/thumb.gif", 0x915d140) = -1 ENOENT (No such file or directory)
stat("/stor/content/My Music/LOCAL/__ARTIST__/Thumb.png", 0x915d140) = -1 ENOENT (No such file or directory)
stat("/stor/content/My Music/LOCAL/__ARTIST__/Thumb.jpg", 0x915d140) = -1 ENOENT (No such file or directory)
stat("/stor/content/My Music/LOCAL/__ARTIST__/Thumb.jpeg", 0x915d140) = -1 ENOENT (No such file or directory)
stat("/stor/content/My Music/LOCAL/__ARTIST__/Thumb.gif", 0x915d140) = -1 ENOENT (No such file or directory)
stat("/stor/content/My Music/LOCAL/__ARTIST__/album.png", 0x915d140) = -1 ENOENT (No such file or directory)
stat("/stor/content/My Music/LOCAL/__ARTIST__/album.jpg", 0x915d140) = -1 ENOENT (No such file or directory)
stat("/stor/content/My Music/LOCAL/__ARTIST__/album.jpeg", 0x915d140) = -1 ENOENT (No such file or directory)
stat("/stor/content/My Music/LOCAL/__ARTIST__/album.gif", 0x915d140) = -1 ENOENT (No such file or directory)
stat("/stor/content/My Music/LOCAL/__ARTIST__/Album.png", 0x915d140) = -1 ENOENT (No such file or directory)
stat("/stor/content/My Music/LOCAL/__ARTIST__/Album.jpg", 0x915d140) = -1 ENOENT (No such file or directory)
stat("/stor/content/My Music/LOCAL/__ARTIST__/Album.jpeg", 0x915d140) = -1 ENOENT (No such file or directory)
stat("/stor/content/My Music/LOCAL/__ARTIST__/Album.gif", 0x915d140) = -1 ENOENT (No such file or directory)
stat("/stor/content/My Music/LOCAL/__ARTIST__/folder.png", 0x915d140) = -1 ENOENT (No such file or directory)
stat("/stor/content/My Music/LOCAL/__ARTIST__/folder.jpg", 0x915d140) = -1 ENOENT (No such file or directory)
stat("/stor/content/My Music/LOCAL/__ARTIST__/folder.jpeg", 0x915d140) = -1 ENOENT (No such file or directory)
stat("/stor/content/My Music/LOCAL/__ARTIST__/folder.gif", 0x915d140) = -1 ENOENT (No such file or directory)
stat("/stor/content/My Music/LOCAL/__ARTIST__/Folder.png", 0x915d140) = -1 ENOENT (No such file or directory)
stat("/stor/content/My Music/LOCAL/__ARTIST__/Folder.jpg", 0x915d140) = -1 ENOENT (No such file or directory)
stat("/stor/content/My Music/LOCAL/__ARTIST__/Folder.jpeg", 0x915d140) = -1 ENOENT (No such file or directory)
stat("/stor/content/My Music/LOCAL/__ARTIST__/Folder.gif", 0x915d140) = -1 ENOENT (No such file or directory)
Comment 1 Michael Herger 2008-08-10 13:34:11 UTC
Ahm... did you forget the patch? :-)
Comment 2 J. Nick Koston 2008-08-10 14:56:12 UTC
Created attachment 3771 [details]
cache stats

That would help :)
Comment 3 Michael Herger 2008-08-11 04:22:22 UTC
A quick test (one pass only) didn't reveal any real advantage on "decent" systems, and little on a NAS:

XP, 11k tracks on USB2 disk: 2'57 (without) vs. 2'50 (with patch)
MacBook, 3.5k on internal disk: 30'' vs. 31''
ReadyNAS, 11k on one disk only: 14'25 vs. 13'33

Please note that the full scan on the ReadyNAS was taking 2h17. Thus that minute isn't really much of an improvement... The difference on the two more powerful machines imho is negligible.
Comment 4 J. Nick Koston 2008-08-11 07:12:58 UTC
On Linux with NFS its the difference from being able to type on the terminal and not.
Comment 5 Andy Grundman 2009-07-29 14:58:39 UTC
Moving 7.4 bugs to 8.0.
Comment 6 Mike Walsh 2009-10-01 08:45:00 UTC
i don't understand...  if its better, why not simply use it, even if it is a small difference?

and he says on linux its a big difference.