https://bugs.kde.org/show_bug.cgi?id=478457

--- Comment #4 from Eddie J Carswell II <eddiecarswel...@yahoo.com> ---
(In reply to Harald Sitter from comment #3)
> > no high CPU/IOwait/Network from kioslave5 (media previews still working)
> 
> You may need to explain this expectation in greater detail. How do you
> reconcile remote-IO-without-wait-time with having to access remote data, as
> would be the case during preview generation? At face value there's always an
> unknown amount of wait time, because we don't know network throughput and
> latency, and then remote drive throughput and latency. Or put simply: the
> only way not to wait is to not read data; when reading data we need to wait
> for the IO.

I meant the overall system IOwait percentage seems to get rather high
(sometimes over 30%) and can sometimes cause other processes to stutter and
lag. My main system drive is an NVMe (LVM on LUKS) so it's rather odd that
kioslave could be causing that much of an issue. I haven't messed with any
kernel parameters or changed the scheduler settings from stock Fedora defaults
here. I'll also note that it's not network bandwidth being the issue, but the
disk read speed of the remote server (spinning rust, also see high iowait when
I checked it during the issue) that causes the local iowait for kioslave.

It also seems weird to me that being bottlenecked on IO to a network filesystem
can still cause visible lag for other processes only doing local IO, unless
there's a shared IO pipeline for all mounted filesystems? Not sure why that is
happening exactly. Either way, reducing the process IO priority could be
helpful here (like maybe idle priority) to reduce the impact.

> > A naive analysis would seem to suggest there are less invasive and resource 
> > intensive ways to generate media previews
> 
> Such as?

I haven't looked at the code, so my suggestions are based on observed behavior.

- I've already mentioned lowering IO priority so it doesn't push out other
processes. I feel that this would be a workload perfectly suited to running at
idle priority, since its an ancillary function that shouldn't impair the
primary functionality of the program (being a file browser).
- Is there anything we can do to reduce the amount of reading necessary to
generate a thumbnail for a video file? Presumably we'd only need to look for
the first few keyframes and stop there. Reducing the per-file IO helps
immensely with large file counts.
- I also notice that hovering will show a mini preview slideshow, so the
program is probably reading a lot further into the file to grab those
thumbnails. Maybe this behavior could be made tunable "disable deep thumbnail
generation" or something. Maybe it should be off by default for non-local
files.
- I mentioned in another comment that renaming or moving a file seems to
invalidate the thumbnail and trigger another generation. Could we link the
generated thumbnails with a more persistent identifier? File hash may not be
useful since that requires reading the file. Maybe the inode? I'm not sure if
an equivalent to inodes would even exist for SMB (NFS does expose persistent
inodes).
- Is this process descending automatically to child directories to be more
thorough? That makes even browsing the level above a large video directory
problematic, and it doesn't seem to quit when I'm no longer in the vicinity of
that directory tree.

Also, if better profiling, metrics, or debugging would be helpful, let me know
what to add.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to