Author Topic: Optimising Logitechmediaserver database  (Read 2264 times)

Offline Rotten Johnny

  • ROONed for life.
  • Administrator
  • Trade Count: (+30)
  • *****
  • Posts: 14,342
Optimising Logitechmediaserver database
« on: December 15, 2012, 08:38:49 AM »
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: [Select]
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: [Select]
vacuum;hit ctrl-d when it's done to be returned to the command prompt
Audiophile: There is almost no other group that prides themselves more on wasting good money on utterly worthless ****, and then trying to furiously blow smoke up their own ass to justify it.

Free your mind...and your ass will follow.

Offline GECO

  • Commercial Member
  • Trade Count: (+6)
  • *****
  • Posts: 7,617
Re: Optimising Logitechmediaserver database
« Reply #1 on: December 15, 2012, 08:55:34 AM »
Sticky please

Offline I Shot Tupac!!!

  • Trade Count: (+6)
  • AVForums Veteran
  • *****
  • Posts: 4,955
Re: Optimising Logitechmediaserver database
« Reply #2 on: December 15, 2012, 10:04:09 AM »
 :notworthy: :notworthy:

Offline lrossouw

  • Trade Count: (0)
  • AVForums Member
  • *
  • Posts: 22
Re: Optimising Logitechmediaserver database
« Reply #3 on: February 08, 2013, 12:39:33 PM »
Does this speed things up significantly?
2x SqueezeBox Touch
1x SqueezeBox Classic
XBMC (soon to be on RPi)
Ubuntu Server (Video & Music)

Offline Rotten Johnny

  • ROONed for life.
  • Administrator
  • Trade Count: (+30)
  • *****
  • Posts: 14,342
Re: Optimising Logitechmediaserver database
« Reply #4 on: February 08, 2013, 12:45:56 PM »
Ye, if your db is fragmented. UI is snappier and scanning time noticeably reduced.
Audiophile: There is almost no other group that prides themselves more on wasting good money on utterly worthless ****, and then trying to furiously blow smoke up their own ass to justify it.

Free your mind...and your ass will follow.

Offline scrarfussi

  • Trade Count: (+20)
  • AVForums Veteran
  • *****
  • Posts: 5,763
  • Quantum In Me Fuit
Re: Optimising Logitechmediaserver database
« Reply #5 on: August 07, 2014, 06:58:23 PM »
think we need a update on this for arch Johnny  :whip:
suum cuique pulchrum est


"I refuse to prove that I exist,'" says God, "for proof denies faith, and without faith I am nothing."

Offline Rotten Johnny

  • ROONed for life.
  • Administrator
  • Trade Count: (+30)
  • *****
  • Posts: 14,342
Re: Optimising Logitechmediaserver database
« Reply #6 on: August 07, 2014, 07:09:47 PM »
The only difference for SoA is a different command set to stop and restart LMS and of course a different location for the cache folder.
Audiophile: There is almost no other group that prides themselves more on wasting good money on utterly worthless ****, and then trying to furiously blow smoke up their own ass to justify it.

Free your mind...and your ass will follow.