The prewarm's single big read (a ~14 min sequential pass over a 60GB remux to demux subtitles) shares the same disk/NFS as live streaming. Lower the prewarm ffmpeg processes to the Linux IDLE I/O class (ioprio_set) so that background read yields bandwidth to a user who's actually watching — the prewarm slows down under contention instead of starving playback, and runs full speed when the disk is idle. Applied only to the prewarm-only extractors (ExtractSubtitlesVTTMulti, ExtractThumbnailJPEG) via Start → setIdleIOPriority(pid) → Wait; the on-demand /sub + /thumbnail handlers keep normal priority (a user is waiting on those). Linux-only syscall behind a build tag; a no-op stub elsewhere. Best-effort — errors ignored, never required for correctness. Verified: the prewarm ffmpeg shows 'idle' under ionice -p; on-demand stays normal. |
||
|---|---|---|
| .. | ||
| ffmpeg.go | ||
| ffmpeg_download.go | ||
| ffmpeg_test.go | ||
| ffprobe.go | ||
| ffprobe_download.go | ||
| ffprobe_download_test.go | ||
| ffprobe_test.go | ||
| ioprio_linux.go | ||
| ioprio_other.go | ||
| lang.go | ||
| lang_test.go | ||
| sidecar.go | ||
| types.go | ||