Skip to content

Speed up Plex Emby Jellyfin

Chaz Larson edited this page Jul 21, 2022 · 6 revisions

IMPORTANT NOTE:

For the Plex role, this is now built into Cloudbox's adv_settings.yml. You can change the value and reinstall Plex and it will do it for you. The deprecated manual way is seen below.


Plex uses sqlite3 for its database. It has default amount of data that it can load into RAM that isn't really fit for purpose for massive libraries. Run the below line by line to increase the amount of data loaded into RAM to ensure quicker loading of your dashboard library i.e. navigating Plex.

I take zero responsibility if your library becomes corrupted as a result of running this tweak. Run at your own risk.

The PRAGMA default_cache_size default is 2000.

Type one line at a time.

Plex no longer supports using the stock SQLite binary to edit its database. They have a version embedded in the Plex Media Server binary that you should use instead.

sqplex="/opt/plexsql/Plex Media Server"
plexdbpath="/opt/plex/Library/Application Support/Plex Media Server/Plug-in Support/Databases"

docker stop plex
docker cp plex:/usr/lib/plexmediaserver/ /opt/plexsql

cd "/opt/plex/Library/Application Support/Plex Media Server/Plug-in Support/Databases"
cp com.plexapp.plugins.library.db com.plexapp.plugins.library.db.original

"${sqplex}" --sqlite com.plexapp.plugins.library.db "pragma page_size=32768; vacuum;"
"${sqplex}" --sqlite com.plexapp.plugins.library.db "pragma default_cache_size = 20000000; vacuum;"

docker start plex

You can delete that backup after deciding that the edit didn't break anything:

rm -f "/opt/plex/Library/Application Support/Plex Media Server/Plug-in Support/Databases/com.plexapp.plugins.library.db.original"

Emby

docker stop emby
cd /opt/emby/data/
sqlite3 library.db
pragma default_cache_size;
# (this will show current size)
pragma default_cache_size = 5000000;
pragma default_cache_size;
# (this will show current size, just to check it worked)
.exit
docker start emby

Jellyfin

docker stop jellyfin
cd /opt/jellyfin/app/data/data/
sqlite3 library.db
pragma default_cache_size;
# (this will show current size)
pragma default_cache_size = 5000000;
pragma default_cache_size;
# (this will show current size, just to check it worked)
.exit
docker start jellyfin

Install Guides

Repository

Apps

Misc Guides

General Stuff

Linux Stuff

Plex

Organizr

Downloading

STRM

Clone this wiki locally