mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-07-16 05:43:54 +03:00
[Issue]: Server spawns many ffmpeg/ffprobe processes no matter the settings, exhausting IO, RAM and CPU #6312
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @detly on GitHub (Sep 28, 2024).
This issue respects the following points:
Description of the bug
I'm using Jellyfin 10.9.11 on a Raspberry Pi 2B+ running Raspbian 12. It's installed from the apt repo at
https://repo.jellyfin.org/debian, not running in Docker.I am aware that running Jellyfin on an RPi is not supported, but:
Shortly after starting, Jellyfin appears to launch
ffmpegprocesses with no limit on number. This completely maxes out memory, CPU and IO to the point where the service is killed by eg. systemd, or the device itself needs to be hard power cycled.So far I have:
ParallelImageEncodingLimitto1in/etc/jellyfin/system.xmlLibraryMetadataRefreshConcurrencyto1in/etc/jellyfin/system.xmlLibraryScanFanoutConcurrencyto1in/etc/jellyfin/system.xmlEncodingThreadCountto1in/etc/jellyfin/encoding.xmlJELLYFIN_FFmpeg__analyzeduration="100M"in/etc/default/jellyfinJELLYFIN_FFmpeg__probesize="50M"in/etc/default/jellyfinNo matter what these are set to, Jellyfin will continue to spawn
ffmpegprocesses until the system is overwhelmed. Substantially reducing theffmpegparameters only means that more individual processes can be spawned before the whole lot (and Jellyfin) are killed. For eg. with the defaults, maybe around 10 processes can be spawned. Turning the limits down as far as they can go means almost a thousand can be spawned before being killed.It is hard to get logs or other debugging information for this, because once the system is overwhelmed I cannot do much of anything to capture it. At times I've been able to use tmux and other tricks to capture things, but even that's hard because I often have to power cycle the thing to recover and it all goes away. (Hence, I apologise for the screenshots instead of text, but it's the best I can get for now.)
It is not one particular piece of media that seems to cause this; the logs show different files being processed over the many different runs I did.
Possibly related (or at least, similar?) issues:
Reproduction steps
I only have to enable/unmask/start the Jellyfin server systemd unit and this happens within 3 minutes.
What is the current bug behavior?
Many
ffmpegprocesses are spawned until the system is overwhelmed.What is the expected correct behavior?
The number of
ffmpegprocesses and the resources they use are governed by configuration settings.Jellyfin Server version
10.9.11+
Specify commit id
No response
Specify unstable release number
No response
Specify version number
No response
Specify the build version
n/a
Environment
Jellyfin logs
FFmpeg logs
No response
Client / Browser logs
No response
Relevant screenshots or videos
Screenshots (from earlier versions but confirmed behaviour is the same in recent versions):
journald logs for first couple of minutes of startup showing env vars and other parameters (from
Jul 06 20:16:11)journald logs shortly after startup when the
ffmpegprocesses started getting out of handhtop showing a bunch of
ffmpegprocesses (this was the last it could refresh before the system became unresponsive)Additional information
I don't know how to get the "build version" since I can't run the server for long enough to let the client connect and read it from the dashboard. Please let me know if there's another way to get it if you need it.
@gnattu commented on GitHub (Sep 28, 2024):
It is doing image extraction and initial library scanning so this is kind of normal operation, it is probably just your Pi2 being too slow so that the image extraction process took (much) longer than expected and the image extraction process does not block the metadata update by design now. This is workaround-able by pooling the image extractor like the skia encoder but for your use case we can do very little because a processor that does not even support 64bit is really not something we will test on and the support for such processor is going to be removed in any time in the future.
@felix920506 commented on GitHub (Sep 28, 2024):
The only thing you could do would be to lower the
Parallel library scan tasks limitsetting in the dashboard.In the info you provided, Jellyfin is working as intended, and your performance issues stem from running Jellyfin on inadequate hardware.
Please refer to our hardware selection guide for more info. https://jellyfin.org/docs/general/administration/hardware-selection
@detly commented on GitHub (Sep 28, 2024):
It's not possible to change settings via the dashboard. The dashboard can't connect to a non-responsive server. Do you know where is this setting stored in the server configuration files?
Do you know roughly when this changed? I'm just trying to reconcile this with the fact that I've been running Jellyfin on this device since 2021 with zero issues, performance or otherwise, until June, when it started trying to spawn 900+ subprocesses simultaneously for image/metadata extraction. I'm skeptical that burning resources on new hardware will help in the face of that.
@detly commented on GitHub (Sep 29, 2024):
@gnattu kindly explained the details of this to me on Matrix, so I'll make notes here in case others encounter this or so devs can refer to it elsewhere.
It's possible that the specifics of which kinds of tasks/pools/etc. are involved are a bit inaccurate; the point is that yes, it can be explained by the limitations of the platform. (To be clear, I am 100% for the devs limiting the scope of what they support. I just saw this and my first instinct was that it was unexpected and unrelated to hardware.)
@gnattu commented on GitHub (Sep 29, 2024):
Well this is not entirely correct because the image extractor is pooled internally as well, but I don't really know why it is not working on your system
@Crrispy commented on GitHub (May 14, 2025):
Hello,
I have the same issue on a QNAP TS-431P. I just want to use it as a local DLNA server, no transcode, nothing fancy. It launches several processes to scan the library, and since I'm on rotational 8TB disks (plus the cpu and ram are very modest), it puts down the nas to a crawl, basically anything above 1 program doing random access on the drives is a mess. I let it run all night and killed it this morning. I'm going to try some of the hints there, but it seems they don't really work?
@lawleagle commented on GitHub (Oct 14, 2025):
I have the same issue, on 10.10.6, on FreeBSD with 96GB of RAM, around 15 of which are usually free. jellyfin spawns hundreds/thousands of ffprobe processes to scan a ~30TB library. honestly, I don't think running 1000 processes in parallel makes any of those processes go fast at all, and the settings in dashboard->general are not honored. already set "Parallel library scan tasks limit" to 8