Jellyfin HA transcoding fork: Redis-backed session failover + experimental PostgreSQL provider #16415
Replies: 2 comments 3 replies
-
|
I would love this to work without the need for shared storage or shared db. Allowing a small amount of loss ( < 1 min ) by utilizing replication and a read only replica that becomes able to write during failover would be awesome. The client knows where it is in a stream anyway so except for very specific cases the failover would not be noticeable at all to users. |
Beta Was this translation helpful? Give feedback.
-
|
If you leave in Redis for session tracking, HA for direct play becomes very do-able — a lot of the shared storage and extra bits are just there as a kind of self challenge. Like if I were to build out a Netflix competitor, that's how I'd do it. @jaredglaser That's a great point — tolerating a small amount of loss (<1 min) and leaning on replication + a promotable read replica is a really clean way to approach this without requiring shared storage at all. The client tracking its own position already covers most of the gap. @jaretclifton Love this setup — lsyncd + sqlite backup over rsync with a HAProxy VIP and a watcher script is honestly pretty elegant for what it is. "Janky? Sure. Function? Very." is basically the best summary of homelab HA philosophy. The fact that it handles the common cases (crash/reboot) cleanly without needing shared storage or a distributed DB is exactly the kind of pragmatic solution that works well in practice. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I've been working on a fork of Jellyfin focused on one specific problem: making HLS transcoding survive pod restarts in a multi-replica Kubernetes deployment.
What it does
Right now, Jellyfin assumes transcode state lives in one server process. If that pod dies, active transcodes die with it. This fork adds a small HA layer so transcode ownership can survive a pod restart:
ITranscodeSessionStoreabstraction for durable transcode session trackingRedisTranscodeSessionStoreimplementation with lease-based ownershipNullTranscodeSessionStorefallback, so single-instance deployments behave exactly like upstream with no config changesI also added an experimental PostgreSQL provider for shared-database deployments, since SQLite is not a good fit once multiple replicas are involved.
What the HA flow looks like
How to run it
There are three practical modes:
1. Single instance
No config needed. It falls back to the no-op store automatically.
2. Local HA test
Run two Jellyfin instances against:
That is enough to test failover behavior locally.
3. Kubernetes / k3s
This is the intended deployment model. You need:
The key config is:
Repo and write-up:
What would be required to merge upstream
I do not expect this to be merged as-is without discussion. If there is interest, I think the realistic path is to split it into small pieces:
ITranscodeSessionStore,TranscodeSession, andNullTranscodeSessionStoreonlyDeleteTranscodeFileTaskI think the HA transcode work has a better chance of review if it is separated from the PostgreSQL provider and migration tooling.
Why I'm posting it
I'm not trying to maintain a permanent hard fork. I built this to see whether Jellyfin could be made to behave well in a replicated environment without rewriting major subsystems. The answer seems to be yes, but it needs maintainers to decide whether this kind of deployment is something upstream wants to support.
If there's interest, I'm happy to break the work into smaller PRs, clean up anything that does not match project direction, and rework the design around maintainer feedback.
Beta Was this translation helpful? Give feedback.
All reactions