[Issue]: Write Lock Contention Causing UI Freezing #4788

Closed
opened 2026-02-07 01:09:24 +03:00 by OVERLORD · 1 comment
Owner

Originally created by @Silvenga on GitHub (Apr 13, 2023).

Originally assigned to: @Bond-009 on GitHub.

Please describe your bug

I'm using a custom image (silvenga-docker/jellyfin-debug) to get process dumps, but these issues are reproducible on the official image.

During library scans, there appears to be a large amount of lock contention around GetConnection. This causes many operations to completely freeze on the UI e.g. loading any media.

image

As shown in the above screenshot, over 55 threads are waiting on a SQLite connection, to either read or write data.

I wonder if it would be possible to:

  1. Allow reads to be multi-threaded (it looks like some work was started here?).
  2. Allow some kind of interweaving - so instead of a single thread making many operations, limit the amount of work a single transaction can do, to reduce the contention (increase fairness).

Ultimately, my goal here is to improve UI responsiveness during load - for UX sakes.

Jellyfin Version

Other

if other:

10.9.0 (version on Master)

Environment

- OS: Ubuntu is the host, but the container is the Official Microsoft image for ASP.NET Core.
- Virtualization: Docker on top of Hyper-V
- Clients:
- Browser:
- FFmpeg Version: Version provided by the official image.
- Playback Method:
- Hardware Acceleration: No
- Plugins:
- Reverse Proxy: nginx
- Base URL: none
- Networking: Bridge 
- Storage: ext4 on top of RBD (Ceph, think block device on the network)

Jellyfin logs

No response

FFmpeg logs

No response

Please attach any browser or client logs here

No response

Please attach any screenshots here

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
Originally created by @Silvenga on GitHub (Apr 13, 2023). Originally assigned to: @Bond-009 on GitHub. ### Please describe your bug I'm using a custom [image (silvenga-docker/jellyfin-debug)](https://github.com/silvenga-docker/jellyfin-debug) to get process dumps, but these issues are reproducible on the official image. During library scans, there appears to be a large amount of lock contention around `GetConnection`. This causes many operations to completely freeze on the UI e.g. loading any media. ![image](https://user-images.githubusercontent.com/2753330/231603310-4f2d94ab-9032-4be7-ada1-1c7acc73b0a0.png) As shown in the above screenshot, over 55 threads are waiting on a SQLite connection, to either read or write data. I wonder if it would be possible to: 1. Allow reads to be multi-threaded (it looks like some work was started here?). 2. Allow some kind of interweaving - so instead of a single thread making many operations, limit the amount of work a single transaction can do, to reduce the contention (increase fairness). Ultimately, my goal here is to improve UI responsiveness during load - for UX sakes. ### Jellyfin Version Other ### if other: 10.9.0 (version on Master) ### Environment ```markdown - OS: Ubuntu is the host, but the container is the Official Microsoft image for ASP.NET Core. - Virtualization: Docker on top of Hyper-V - Clients: - Browser: - FFmpeg Version: Version provided by the official image. - Playback Method: - Hardware Acceleration: No - Plugins: - Reverse Proxy: nginx - Base URL: none - Networking: Bridge - Storage: ext4 on top of RBD (Ceph, think block device on the network) ``` ### Jellyfin logs _No response_ ### FFmpeg logs _No response_ ### Please attach any browser or client logs here _No response_ ### Please attach any screenshots here _No response_ ### Code of Conduct - [X] I agree to follow this project's Code of Conduct
OVERLORD added the enhancement label 2026-02-07 01:09:24 +03:00
Author
Owner

@srcrist commented on GitHub (Oct 6, 2023):

Issue should be closed by https://github.com/jellyfin/jellyfin/pull/9643.

@srcrist commented on GitHub (Oct 6, 2023): Issue should be closed by https://github.com/jellyfin/jellyfin/pull/9643.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/jellyfin#4788