Optimising Logitechmediaserver database

AVForums

Help Support AVForums:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.

Now Playing

AVForums Super Veteran
Joined
May 25, 2010
Messages
1,208
Reaction score
13
Location
South Africa
If you've a large library and you're constantly adding new music to your Squeezebox, improving artwork, adding tags and moving or deleting albums you may find that over time LMS is not quite as snappy as you'd like it.  The underlying reason is that the database becomes fragmented as records relating to deleted/ moved albums etc. are set aside for new additions rather than being purged. To speed things up all you need do is stop LMS, load artwork.db, library.db and persist.db in sqlite's command line interpreter and issue a vacuum command for each.  This results in the database file being packed with deleted records etc. being omitted.  When you're done restart LMS and you should see snappy performance again.

Here's how I do it in Ubuntu server (assumes you're already in the correct folder where the db files are housed):
Code:
sudo service logitechmediaserver stop        ## stop LMS
sudo chown root:root *.db                    ## change ownership of the database files to root
sudo sqlite3 artwork.db                      ## open the db file using the sqlite interpreter then issue the vacuum command and hit ctrl-d when it's done to be returned to the command prompt
sudo chown logitechmediaserver:nogroup *.db  ## revert ownership of the db files to the logitechmediaserver user
sudo service logitechmediaserver start       ## restart LMS

Issuing the vacuum command in sqlite is simply a matter of typing
Code:
vacuum;
hit ctrl-d when it's done to be returned to the command prompt
 
Top