Jellyfin Forum
SOLVED: Does high CPU cause buffering on a direct play? - Printable Version

+- Jellyfin Forum (https://forum.jellyfin.org)
+-- Forum: Support (https://forum.jellyfin.org/f-support)
+--- Forum: Troubleshooting (https://forum.jellyfin.org/f-troubleshooting)
+--- Thread: SOLVED: Does high CPU cause buffering on a direct play? (/t-solved-does-high-cpu-cause-buffering-on-a-direct-play)



Does high CPU cause buffering on a direct play? - podonnell - 2024-06-19

I was watching a video via direct play (no transcode involved) last night. The file is about 10GB and it was being streamed internal to my network.
After about 10 minutes of watching with no issue, a task kicked off on my server that uses the CPU a decent amount.

After a bit, this caused my player to reach Cache: 0, which meant I had no 'buffer' to play. It ended up loading very slowly from that point on, freezing often.
I was using MPV Shim as the player.

Would the process that utilized the CPU really cause this? 
There may have been another process that was using the disk at the same time, and I also wonder if the process of streaming it from the disk was held due to that.

I know the solution here is to avoid those kinds of activities, but for the sake of it - Why wouldn't the entirety of the 10GB file be loaded into cache within a minute or two? I'm on a gigabit network.
Is this the normal behavior of the MPV Shim player? Does it only load a certain amount of cache, and then wait for the player to catch up and load more?


RE: Does high CPU cause buffering on a direct play? - TheDreadPirate - 2024-06-19

Just about all streaming services/platforms (commercial or self-hosted) only buffer 30 to 60-ish seconds or content most of the time. Why transfer the entire video when there is no guarantee that you will watch the entire video in one sitting? Sure, its fine on local networks. But what if you were not at home, or on mobile, or were hosting on a VPS?

Other than bit rate limiting for remote connections, Jellyfin does not treat local vs remote clients differently in terms of buffering.


RE: Does high CPU cause buffering on a direct play? - Efficient_Good_5784 - 2024-06-19

(2024-06-19, 05:52 PM)podonnell Wrote: Is this the normal behavior of the MPV Shim player? Does it only load a certain amount of cache, and then wait for the player to catch up and load more?
Yes. I don't know the exact cache size it uses by default, but if it's the same as Jellyfin Media Player's default, it should be 75MB of cache.

The player will only load up enough data until the 75MB are full, then it will start replacing it as you progress through the video.

This depends per video's bitrate, but I've only ever noticed Shim's cache grow to about 8 minutes ahead of where I'm currently at by default.

Jellyfin Media Player does have an option to let you set it up to 500MB of cache however.


RE: Does high CPU cause buffering on a direct play? - podonnell - 2024-06-20

Good deal, that makes sense then. Although I worry as that makes the catch-up time really short if there's an issue on the server for a bit.

So just to close this out, would the CPU or Disk utilization be responsible for the very slow speeds thereafter? It was a direct play.


RE: Does high CPU cause buffering on a direct play? - podonnell - 2024-06-27

Just wanted to wrap back around on this one. Trying to determine if a CPU upgrade would help this, or if this experience where the data is no longer being fed and the cache empties to 0 would be disk related. I often load data on and off the disk that Jellyfin reads from, so I would have to find a way to lower that priority or something otherwise.


RE: Does high CPU cause buffering on a direct play? - TheDreadPirate - 2024-06-27

If your media direct plays you can run Jellyfin on a potato. I mean, people ca run Jellyfin on Raspberry Pis as long as they plan properly.

Due to this, its hard to suggest a hardware upgrade without fully understanding the root of the problem. If you have a more powerful computer that you can run a test instance on, maybe you can try that before committing to spending money you may not need to spend.


RE: Does high CPU cause buffering on a direct play? - Efficient_Good_5784 - 2024-06-27

Do you have another machine that has a stronger CPU which you can use to test your idea out on?
If you do, why not try it out on that

edit: sorry, miss-clicked the mark as solution button on my comment.