Jellyfin Forum
Any ways to optimize search speed for large libraries? - Printable Version

+- Jellyfin Forum (https://forum.jellyfin.org)
+-- Forum: Support (https://forum.jellyfin.org/f-support)
+--- Forum: General Questions (https://forum.jellyfin.org/f-general-questions)
+--- Thread: Any ways to optimize search speed for large libraries? (/t-any-ways-to-optimize-search-speed-for-large-libraries)



Any ways to optimize search speed for large libraries? - Zedniac - 2024-09-18

Hi all, new to Jellyfin but a longtime Plex user. I'm satisfied with Plex for my video needs, but most of what I use it for is music, and Plex has proved more and more difficult to work with. The lack of support for multiple artists in a single tag field, and terrible offline / downloads support on Plexamp have been the main pain points. I installed Jellyfin the other night, and right off the bat it seems to be much better in these regards. Plus I won't have to deal with some of the needless limitations of Plexamp, like the 24h playlist download limit....mind boggling that that was ever approved.

Anyway, the only issue I'm seeing is that search is just not as fast as I'm used to on Plexamp. It's not, like, catastrophically slow, but just slow enough to be a bit annoying. When searching from the Jellyfin WebUI for a specific artist, it takes around 6-7 seconds to return any results. On Finamp it seems to be a bit faster, maybe 3-4 seconds. (I'm guessing this is because Finamp categorizes things by artist, album, etc, so I imagine I'm just searching the list of artists instead of every metadata field.) My music library is a little over 150,000 tracks, so not record breaking but not small by any means. Totally understandable that mine would take a bit longer to search than a regular person's 10,000 track library, but I guess I've been spoiled by Plexamp (and Spotify, and MusicBee) which can return search results in less than a second.

Does anyone have some tips or tricks for improving search speed? I'm unsure what the bottleneck is, as my CPU utilization, RAM utilization, and read speed from the appdata SSD don't increase much at all when using search. I also don't see any errors in the Docker log when searching. I saw a few posts about Meilisearch / JellySearch. That seems kinda complicated to set up, but I'm willing to give it a go if that's the best option. Otherwise I had the idea to set it up so the database file is stored in RAM to return faster results, but since read speed doesn't seem like the issue, not sure if that would help much.

Posting in General Questions rather than Troubleshooting since there's not really an error occurring, seems like this might just be default behavior which I'd like to improve upon. If this should go in Troubleshooting instead just let me know.

Below is some information on my setup, if any more information would help just let me know. Thanks for any help!

OS: Unraid 6.12.4
Jellyfin version: 10.9.11 (installed via Docker)
CPU: Intel i5-8400
RAM: 2x32GB DDR4-3200
OS / appdata drive: Intel 660p Series M.2 (1TB)
Storage: (4) 14TB WD140EDGZ (Western Digital white label, shucked, one drive is for parity)

Also thought I should mention, Jellyfin is not currently scanning for media (completed that the other day) nor is it doing any other maintenance tasks like checking audio normalization levels or anything. Additionally, everything else in Jellyfin is nice and quick (playing media, navigating between media AFTER searching, etc), search is the only thing that seems to run slowly.


RE: Any ways to optimize search speed for large libraries? - pixel24 - 2024-09-18

The search functionality in Jellyfin is currently, in my opinion, a disaster when it comes to speed. From what I've read, this is due to tags being included in the search (since version 10.9), but that's only half-knowledge! It gets really terrible when searching with Finamp, where it's even slower than in the web UI. The fact is, a database search should be much faster. So if anyone has a trick up their sleeve to speed up the search, I'd be very interested.


RE: Any ways to optimize search speed for large libraries? - Zedniac - 2024-09-18

(2024-09-18, 10:25 AM)pixel24 Wrote: The search functionality in Jellyfin is currently, in my opinion, a disaster when it comes to speed. From what I've read, this is due to tags being included in the search (since version 10.9), but that's only half-knowledge! It gets really terrible when searching with Finamp, where it's even slower than in the web UI. The fact is, a database search should be much faster. So if anyone has a trick up their sleeve to speed up the search, I'd be very interested.

Well I ended up getting impatient last night and installed Jellysearch last night, and it did improve search speed significantly. Searching in the Jellyfin WebUI takes around 1 second instead of 6-7 now. Same in Finamp, but the issue is that it won't return any results when searching under the Artists tab. I'll poke around and see if I can figure it out, but I'm not sure where the issue is. Finamp's logs show the same thing for a successful Album search and an unsuccessful Artist search, and the Jellysearch log just shows "No hits, not proxying" when searching Artists in Finamp. I posted in the Jellysearch thread as well so if anyone has any insight on the issue I can relay it here. Overall I'd still recommend Jellysearch in its current state, since it's literally faster to search for an album, click the album, then click the artist than it is to wait for default Jellyfin search to return anything.


RE: Any ways to optimize search speed for large libraries? - TheDreadPirate - 2024-09-18

You could remove all tags from the database, if you don't care about them.  You'd have to install sqlite3 and open the database file after stopping the jellyfin container.  Since this is unRAID, I'm not sure if you'd be able to do this on the server.  But you could copy the library.db file to another PC and run the commands there.

I strongly recommend backing up your install before attempting this.

Code:
DELETE FROM TypedBaseItems
WHERE Tags IS NOT NULL



RE: Any ways to optimize search speed for large libraries? - Zedniac - 2024-09-18

Are the tags you're referring to specifically the ones listed under the Tags heading under View Metadata? If so, none of the music I've checked has any tags right now. The only metadata there that I know Jellyfin added is the MusicBrainz IDs, everything else listed seems to come from the ID3 tags of the music files.


RE: Any ways to optimize search speed for large libraries? - TheDreadPirate - 2024-09-18

Yes. The tags in the metadata view. If you have video content, those tags would also be searched.


RE: Any ways to optimize search speed for large libraries? - Zedniac - 2024-09-18

Ah gotcha. I currently don't have any video content, just music, and those don't seem to have any tags. I do appreciate the suggestion though! Jellysearch improved the speeds a lot so as long as I cant get it to work properly with Finamp I should be squared away.