Back to Blog
homelab
4 min read

Jellyfin stutters: Heavy processing

A follow-up to my transcoding post: Jellyfin stuttered on direct play too. The Pi's CPU was at 90%+ because qBittorrent and Bazarr were working through four seasons of a show at once.

Tang Yetong
Tang Yetong
Full Stack Developer and former Data Analyst Intern at Fivetran with a background in government digital services and blockchain technology.

In my last blog about transcoding, the stutter came down to the Pi converting a 4K Dolby Vision file it couldn't keep up with. Then it stuttered again, and this time nothing was being transcoded.

Direct play, and still stuttering

By now I knew where to look first, so I opened the Jellyfin dashboard while it was stuttering. The session said "Direct playing". Nothing was being converted, the TV understood every part of the file and the Pi was just sending it over.

That ruled out everything from the last post. If the formats were fine and it still stuttered, then something else was keeping the Pi from sending the file fast enough.

Look at the CPU

So I SSHed into the Pi and looked at what it was doing. The CPU usage was sitting at 90% or more, which is a lot for a Pi that is supposed to be just playing a file. If your stack runs in Docker, this shows which container is busy:

docker stats --no-stream
Readout · what I checked3 checks
Jellyfin sessionIn the dashboardDirect playingNothing was being convertedRuled out
CPU usageOver SSH90%+ busyThe Pi was overloadedThe problem
The busy appsLooking aroundBazarr and qBittorrentFour seasons of Tulsa King at onceThe cause

Who was using it

After digging around, it was Bazarr and qBittorrent. Seerr had been instructed to request a show with four seasons, Tulsa King, and had all of it queued up, and both of them were churning through all of it at once.

Seerr hadn't done anything wrong. The person who requested the show wanted all the seasons, so it asked for all four.

Everything in the stack lives on the same Pi, with the same four cores. qBittorrent is busy for as long as it has many active torrents, and Bazarr is busy for as long as it has a pile of episodes to look at. Jellyfin only needed a small share to direct play one file, but when two apps take most of the CPU, that share gets squeezed.

Diagram · one Pi, four cores, everything on itShared CPU
90%+CPU busyRaspberry Pi 5 · 4 cores
IdleMaxed out
qBittorrentFour seasons downloadingBazarrFour seasons of episodesJellyfinDirect playing one fileEverything elseSeerr, Sonarr, Radarr, Prowlarr, Docker

Direct play is light work, but it still needs its share of the CPU, and with the Pi this busy it was probably getting less than it needed.

The fix: one torrent at a time

I limited qBittorrent to one active torrent. The rest of the season now waits in the queue and gets worked on one after another, so there is much less going on at any moment. While playing a movie or show, the CPU is back to around 20 to 30%, and the stutter is gone.

Diagram · before and after the limitqBittorrent queueing

In qBittorrent this is in the options, under BitTorrent and then Torrent Queueing. Set the maximum active torrents to 1. The labels might differ a little on your version.

It does mean a whole show takes longer to arrive, since the episodes are no longer downloading side by side.

Watching it without SSH

This is the second time a stutter turned out to be the Pi working too hard, so a graph is easier than SSHing in every time. Beszel, the monitoring dashboard from the last post, shows the CPU chart too. Picking 12 or 24 hours shows what happened last night.

Tags

Jellyfin
qBittorrent
Bazarr
Sonarr
Raspberry Pi
Beszel
Self-hosted
Homelab
Tang Yetong

Tang Yetong

Full Stack Developer and former Data Analyst Intern at Fivetran with a background in government digital services and blockchain technology.

Related Articles

Featured image for Jellyfin stutters: Transcoding
7 mins

Jellyfin stutters: Transcoding

homelab

A follow-up to my arr stack post: how Jellyfin chooses between direct play and transcoding, why one TV stuttered on a 4K Dolby Vision film, and why the Raspberry Pi struggles.

Jellyfin
Transcoding
Raspberry Pi
+6
Read Article: Jellyfin stutters: Transcoding
Featured image for Jellyfin: Avoiding subscriptions like the plague
14 mins

Jellyfin: Avoiding subscriptions like the plague

homelab

How I set up an arr stack (Jellyfin, Radarr, Sonarr, Prowlarr and qBittorrent) with Docker Compose on a Raspberry Pi 5 8GB and a 1TB external hard drive.

Arr Stack
Raspberry Pi
Docker
+5
Read Article: Jellyfin: Avoiding subscriptions like the plague