mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-05-04 18:09:12 +03:00
[Issue]: Reduce the number of queries #3566
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 @jaysonsantos on GitHub (Jan 22, 2022).
Please describe your bug
Hi there, first thank you all for this amazing project, I really want to see Jellyfin as a 1st grade product :).


I'd like to open this issue in order to propose query reduction per routes, so this could make more effective usage of the disk when sqlite has to fetch data from it.
To try and measure the pain points of the app, I started a branch to instrumentate the code with opentelemetry (if it is something you would like to have upstream, let me know).
Here you can see an average of time per route, note that my local server uses HDD, so any random read would suffer.
Then you can see on the details, that many queries will be issued (a bit hard to see here, but i can share the dashboard with whoever wants to see it).
The effects of this is that you can also see that it seems to be locked in a transaction because other threads/tasks are using the db for a longer period.

What do you say? Do you see this as an improvement to be made?
I see slow endpoints even when running from my dev machine with nvme, so I guess that the locks are the ones affecting its performance.
Jellyfin Version
Other
if other:
master branch
Environment
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
@cvium commented on GitHub (Jan 22, 2022):
I would personally be interested in seeing how you did the instrumentation, but I'm not sure it's something we'd upstream.
@jaysonsantos commented on GitHub (Jan 23, 2022):
@cvium my current local patch you can find here https://gist.github.com/0ae616d0f3c73c577da8eff72707e1f6
@jaysonsantos commented on GitHub (Jan 23, 2022):
@cvium the cool thing is that it could be upstreamed without additional "weight" on standar installations because it only reports for subscribers of the ActivitySource's, and it could be only activated if provided a collector's url, i guess this would help observe patterns where the app is being slow
@jellyfin-bot commented on GitHub (May 23, 2022):
This issue has gone 120 days without comment. To avoid abandoned issues, it will be closed in 21 days if there are no new comments.
If you're the original submitter of this issue, please comment confirming if this issue still affects you in the latest release or master branch, or close the issue if it has been fixed. If you're another user also affected by this bug, please comment confirming so. Either action will remove the stale label.
This bot exists to prevent issues from becoming stale and forgotten. Jellyfin is always moving forward, and bugs are often fixed as side effects of other changes. We therefore ask that bug report authors remain vigilant about their issues to ensure they are closed if fixed, or re-confirmed - perhaps with fresh logs or reproduction examples - regularly. If you have any questions you can reach us on Matrix or Social Media.