mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-05-04 18:09:12 +03:00
[Issue]: Jellyfin gets slow over time, eating up all CPU and showing stuck ffmpeg processes #5999
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 @Schaka on GitHub (Jun 12, 2024).
Please describe your bug
Over time, I've noticed since 10.9.x that Jellyfin tends to get really slow. I've been monitoring system resources with htop and container resources with Docker to try and figure this out but haven't been able to.
It seems some ffmpeg tasks never finish and they start adding up. I've tried to have a look at my log file to see if anything is amiss but couldn't spot anything. I was also not able to reproduce this reliably. I thought it may have been the new Keyframe Extractor or similar.
Also small note: IntroSkipper says ConfusedPolarBear, but that's only the package - it's the new one that works with 10.9
One more thing I can think of: I have some libraries that are purely symlinks of items available in other libraries. It's how I manage letting family and friends know what media is going to be removed soon and to watch it now or never. Maybe playing via symlink could cause some of these issues. These links are written and re-written automatically. It's not unimagineable that this would happen while something is being processed for these "files". That being said, those libraries have everything but metadata fetching disabled.
I'm tossing my log files here because they're too large for GitHub and I unfortunately don't see any section I could determine as relevant:
jellyfin.log
ffmpeg.txt
Reproduction Steps
Jellyfin Version
10.9.0
if other:
No response
Environment
Jellyfin logs
FFmpeg logs
No response
Please attach any browser or client logs here
No response
Please attach any screenshots here
No response
Code of Conduct
@jellyfin-bot commented on GitHub (Jun 12, 2024):
Hi, it seems like your issue report has the following item(s) that need to be addressed:
This is an automated message, currently under testing. Please file an issue here if you encounter any problems.
@cvium commented on GitHub (Jun 12, 2024):
What you are seeing are Jellyfin threads, not ffmpeg.
--ffmpegis just a commandline argument in Jellyfin specifying the location of the ffmpeg binary.I don't really see anything wrong in that htop nor do your logs seem to indicate any glaring issues. I would suggest you uninstall Jellyfin.Plugin.OpenSubtitles or fix the auth though
@Schaka commented on GitHub (Jun 12, 2024):
Thanks for the hint regarding OpenSubtitles. I had already done that when I saw the logs. Hadn't really been using it in a while anyway.
What I've noticed is that one thread gets stuck doing God knows what and eating up all the CPU resources available to the container. Docker shows 120-200% CPU usage and Jellyfin's webserver responds incredibly slowly. It also takes up about 20GB more RAM than after restarting the container.
In htop, I've seen roughly the same thing, although as you can see the entire server's CPUs aren't really stretching their legs.
This using the official Jellyfin image, not LSIO. I'm not limiting the container's resources, although I think if a few changes I've made to try and fix it now don't turn out to solve the problem, I may give that a shot.
@PhilAllmighty commented on GitHub (Jun 13, 2024):
Got the same issue and I think it comes from the introskipper plugin. When uninstalled... no more problem... and the issue comes back as soon as I reinstall it and I have to restart the container to fix it temporarily.
@Schaka commented on GitHub (Jun 13, 2024):
I'll report it there as well. It's odd, because just triggering the task via the dashboard, I was never able to reproduce it.
Not for my home server where it's constantly in use either. So I figured it wouldn't be that.
@xd003 commented on GitHub (Jun 13, 2024):
related - https://github.com/jellyfin/jellyfin/issues/11551
@PhilAllmighty commented on GitHub (Jun 17, 2024):
so far so good since intro-skipper release 0.2.0.10. How about you?
@Schaka commented on GitHub (Jun 17, 2024):
I've been mostly good since limiting multi threading like suggested here: https://github.com/jumoog/intro-skipper/issues/199#issuecomment-2165195209
My suspicion is that either it'll take longer to happen now or if there's only ever one thread it gets cleaned up properly.
@PhilAllmighty commented on GitHub (Jun 17, 2024):
Yeah I saw that but it didn't change a bit... for me it was the updated plugin that made the difference.
@Schaka commented on GitHub (Jun 28, 2024):
I just happened again last night with limited multi threading on 10.9.7 and the "fixed" intro-skipper plugin.
The container was using 20GB+ of RAM at the time and everything slows down when my system starts swapping onto the slow spinning drives.
@PhilAllmighty commented on GitHub (Jul 1, 2024):
Oh well... I guess it's something else then. I haven't had an issue since the updated plugin. If that makes a difference... ds920 w 20GB memory
@jawtis commented on GitHub (Jul 24, 2024):
I have same problem when android app cant play a video. With every retry ram usage build up.
@JPVenson commented on GitHub (Sep 4, 2024):
Hey there, as you reported this seems to be an issue with the external plugin. I looked it up and he actually had an memory leak in there so its plausable. However this report is on the wrong repo then.
@Schaka commented on GitHub (Sep 4, 2024):
The problem was related to whatever is causing the ongoing memory problems with 10.9.x
Additionally, I had swapping enabled in my OS, which slowed Jellyfin down to a crawl. This happened both with and without the plugin. I believe the CPU usage it showed was because it got stuck running longer running tasks like the library scan forever and writing data to swap when it shouldn't have.
I misinterpreted this as Jellyfin using up all CPU resources (it didn't, 100% in Docker is not actual 100% in your OS) and that's why it became too slow to even serve the web UI resources.
I don't believe there is a problem with high CPU usage.
@felix920506 commented on GitHub (Sep 4, 2024):
The ffmpeg processes not getting disposed of is not a Jellyfin bug, but a bug with the intro skipper plugin.
The memory usage bug is being looked into but we still don't know the problem yet, that is being tracked in another issue. Please report anything further over there.