jl94x4 14 Posted February 20, 2018 Share Posted February 20, 2018 (edited) So im a former Plex user and the biggest feature i miss is storing the DB in RAM for much faater responce times.This was achieved by using this command. sqlite3 -header -line "/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Plug-in Support/Databases/com.plexapp.plugins.library.db" "PRAGMA default_cache_size = 1000000"Is there a way to do this on Emby? Edited February 20, 2018 by jl94x4 1 Link to comment Share on other sites More sharing options...
Luke 37244 Posted February 20, 2018 Share Posted February 20, 2018 FYI this is a sqlite param that allows for a larger cache size. That's not the same thing as putting the db in memory. 1 Link to comment Share on other sites More sharing options...
jl94x4 14 Posted February 20, 2018 Author Share Posted February 20, 2018 FYI this is a sqlite param that allows for a larger cache size. That's not the same thing as putting the db in memory. Maybe so, it does considerately improve loading times. Does anything like this exist for Emby? Link to comment Share on other sites More sharing options...
Luke 37244 Posted February 21, 2018 Share Posted February 21, 2018 Currently no but it's possible for the future, thanks. Link to comment Share on other sites More sharing options...
ddurdle 75 Posted May 17, 2018 Share Posted May 17, 2018 One of my test servers has very large test database of media. The larger it got, the more cpu-bound wait i/o I've been witnessing. Doing a trace, most of the i/o waits was caused for the constant reading of library.db. I found the file fragmented over the disk (which is understandable). At very minimum, making a copy and replacing the original with the copy will eliminate this fragmentation. Even better performance could be had by moving your .db files to faster disk. My test servers are all running on the cheaper side. I don't want to be "that guy" that specs out a test server to be $65/month just to have enough cpu, SSD, etc. A "free" way of gaining a lot of performance would be to move the db file to RAM. Just like your original question about moving the library to RAM. My library db is only about 800MB, so I created a "ramdisk" and relocated the file to there. The performance gains is night and day. It was taking sometimes nearly a minute to navigate around the huge library. Now it is instantaneous. The system has that "fresh" feel and has the responsiveness of a system with a library of just 100 video files. Extreme care must be done if you decide to try this. Init scripts to create the file on the ramdisk on startup, link the file to the ramdisk, backup the file on shutdown. Schedule online dirty backups of the file as well. There are lots of tricks to this. Link to comment Share on other sites More sharing options...
Luke 37244 Posted May 17, 2018 Share Posted May 17, 2018 Great tip, thanks. Link to comment Share on other sites More sharing options...
Jambercob 12 Posted May 18, 2018 Share Posted May 18, 2018 If you have enough memory you could just use the portable version of emby server and run it from a ramdisk (I'm currently doing this). The load times are nearly instant and that's with an extremely large library. Of course as mentioned above, you would need to make sure the ramdisk syncs to a folder or image file and is loaded again upon startup. I set mine to just sync changes once a day and then the folder it syncs to is also backed up to another disk. I do not sync on system reboots because it would take 20+ minutes to do a reboot. Link to comment Share on other sites More sharing options...
Riggs 300 Posted May 18, 2018 Share Posted May 18, 2018 FYI this is a sqlite param that allows for a larger cache size. That's not the same thing as putting the db in memory. Ok, for me this is better. However, is there some trick to optimize/refresh the database? Thanks in advance Link to comment Share on other sites More sharing options...
Luke 37244 Posted May 18, 2018 Share Posted May 18, 2018 In the future we can look at the ability to offer the vacuum command. 2 Link to comment Share on other sites More sharing options...
Riggs 300 Posted May 18, 2018 Share Posted May 18, 2018 In the future we can look at the ability to offer the vacuum command. Awesome, thank you! Link to comment Share on other sites More sharing options...
CBers 6787 Posted May 18, 2018 Share Posted May 18, 2018 Compacting the Database appears to help speed things up a bit. @@PenkethBoy has a PowerShell script for Windows users. 2 Link to comment Share on other sites More sharing options...
Riggs 300 Posted May 18, 2018 Share Posted May 18, 2018 (edited) Compacting the Database appears to help speed things up a bit. @@PenkethBoy has a PowerShell script for Windows users. I have to say thank you, the system not allow me say thanks in your comment Done! I do the process, looks better Edited May 18, 2018 by HRSCR Link to comment Share on other sites More sharing options...
maximumentropy 23 Posted May 18, 2018 Share Posted May 18, 2018 My system's performance is terrible, almost completely unusable, without something like this. I've been using a kludge for some time now to mitigate the problem ... I wrote a simple a python script to read library.db every 5 seconds. This forces it to stay in the windows in-RAM cache. With that running all the time, the performance is great. For what it's worth, I do a manual VACUUM / ANALYZE / REINDEX every once in a while, but it's not enough by itself to maintain normal performance here. It would be great if Emby server did something internally to keep the database in cache. Thanks! 1 Link to comment Share on other sites More sharing options...
ddurdle 75 Posted May 18, 2018 Share Posted May 18, 2018 If you have enough memory you could just use the portable version of emby server and run it from a ramdisk (I'm currently doing this). The load times are nearly instant and that's with an extremely large library. Of course as mentioned above, you would need to make sure the ramdisk syncs to a folder or image file and is loaded again upon startup. I set mine to just sync changes once a day and then the folder it syncs to is also backed up to another disk. I do not sync on system reboots because it would take 20+ minutes to do a reboot. You don't need to store and run Emby from RAM. You want to store the database files on ramdisk. In windows you can use junction points to link the db files from emby to the ramdisk db files or use symlinks on Mac/Linux/other. You could also store the cache files on ramdisk the db files themselves is the bottleneck. 1 Link to comment Share on other sites More sharing options...
Jambercob 12 Posted May 18, 2018 Share Posted May 18, 2018 Good point @@ddurdle. If you're looking to just do the db file you sure could use a symbolic link within whichever OS you're running. Link to comment Share on other sites More sharing options...
gerritv 4 Posted October 29, 2018 Share Posted October 29, 2018 You don't need to store and run Emby from RAM. You want to store the database files on ramdisk. In windows you can use junction points to link the db files from emby to the ramdisk db files or use symlinks on Mac/Linux/other. You could also store the cache files on ramdisk the db files themselves is the bottleneck. Would I still need to a) copy the file to Ramdisk each time, arrange for the ramdisk to save the file to 'real' storage at regular intervals? I am thinking of using the AMD Ramdisk sw. Link to comment Share on other sites More sharing options...
Luke 37244 Posted October 29, 2018 Share Posted October 29, 2018 What are you trying to accomplish? Link to comment Share on other sites More sharing options...
gerritv 4 Posted October 29, 2018 Share Posted October 29, 2018 I am trying to see if this will improve the 4-5 minute wait for Collections to appear on my HTPC. I have >1500 movies, and 4 collections. 1 collection has 37 movies, the other 3 just 10 or less each. Link to comment Share on other sites More sharing options...
Happy2Play 8355 Posted October 30, 2018 Share Posted October 30, 2018 I am trying to see if this will improve the 4-5 minute wait for Collections to appear on my HTPC. I have >1500 movies, and 4 collections. 1 collection has 37 movies, the other 3 just 10 or less each. The change to the next release (3.6) should improve those times Link to comment Share on other sites More sharing options...
gerritv 4 Posted October 30, 2018 Share Posted October 30, 2018 Awesome, I will await the next release. Thank you for great support. Link to comment Share on other sites More sharing options...
gerritv 4 Posted November 21, 2018 Share Posted November 21, 2018 Seems better timing now on 3.5.3. Not consistent though. I think I will see if cleaning up the db helps even more, it is now >650mb Link to comment Share on other sites More sharing options...
Luke 37244 Posted November 21, 2018 Share Posted November 21, 2018 The next release will perform considerably faster. Thanks. Link to comment Share on other sites More sharing options...
Luke 37244 Posted July 18, 2019 Share Posted July 18, 2019 How to vacuum your Emby server database: https://emby.media/community/index.php?/topic/75510-42032-vacuum-database-config-switch/ Thanks. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now