Linux client startup very slow

Solved!
Reply
Highlighted

Linux client startup very slow

Casual Listener

Plan

Premium (Family)

Country

Brazil

Device

Dell Inspiron 14 Series

Operating System

Linux Mint 19.3 Xfce

 

My Question or Issue

Unlike the startup on Windows client, on Linux it's very slow to startup the Spotify client. Sometimes it gets so slow that I prefer to open the browser and enter in YouTube Music while the Spotify client starts. I love Spotify, and I'm very happy with the fact that you have a Linux client, you're the best! But, with some issues to solve, that slow startup is one of them. Thanks a lot for your attention!

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Solution!

Re: Linux client startup very slow

Casual Listener
So : I poked around in the directory `~/.cache/spotify`

I have 11G of cached music in there but that doesn't seem to be the issue.
There's a database : `mercury.db`, this appears to be an mostly an index of all the cached data blocks and a few other things. This is a sqlite3 database.

I closed Spotify, opened the database thus

sqlite3 mercury.db

And did this at the sqlite3 console

VACUUM;

Then ctrl-D to exit.

My Spotify client started *much* faster this morning.

View solution in original post

7 Replies
Highlighted

Re: Linux client startup very slow

Rock Star 16
Rock Star 16

Hey @pedro2012 

 

I can tell it's one of the slowest programs to open on my machine as well (other is Wine Foobar), but yours seems a bit extended. 🙂

Can you tell if it has been that slow all the time, or is it becoming slower on you?

 

Also, does anything change when you disable local files (if you have them enabled)?

 

Have a nice day!

SebastyRock Star 16
Help others find this answer and click "Accept as Solution".
If you appreciate my answer, maybe give me a Like.
Note: I'm not a Spotify employee.
Highlighted

Re: Linux client startup very slow

Casual Listener

Hello!

 

Thank you for your attention. I don't have the local files enabled, but that doesn't really change much. It's slow just to startup; once it's fully started it works perfectly well without any significant delay. If you want, I could make a video for demo.

 

Have a nice day too 🙂

Highlighted

Re: Linux client startup very slow

Rock Star 16
Rock Star 16

@pedro2012 

 

A video would be nice! 🙂

 

I can tell my client also starts up rather slow (~3 seconds), and once it's running, there is no problem with any delays or anything. I do have a SSD in the machine, so I don't know how slow would it be on HDD.

 

Did you install Spotify with Snap?

Also, what distro are you running?

 

Looking forward to your reply 🙂

SebastyRock Star 16
Help others find this answer and click "Accept as Solution".
If you appreciate my answer, maybe give me a Like.
Note: I'm not a Spotify employee.
Highlighted
Solution!

Re: Linux client startup very slow

Casual Listener
So : I poked around in the directory `~/.cache/spotify`

I have 11G of cached music in there but that doesn't seem to be the issue.
There's a database : `mercury.db`, this appears to be an mostly an index of all the cached data blocks and a few other things. This is a sqlite3 database.

I closed Spotify, opened the database thus

sqlite3 mercury.db

And did this at the sqlite3 console

VACUUM;

Then ctrl-D to exit.

My Spotify client started *much* faster this morning.

View solution in original post

Highlighted

Re: Linux client startup very slow

Casual Listener

WOW! That really worked like magic, thank you very much! As a enthusiastic of computer science I must ask: how did you do that? I did a quick research over the internet and I found this article https://www.sqlitetutorial.net/sqlite-vacuum/ with more detailed information about what this command does and it totally makes sense to me that you used this command specifically.

 

Best Regards!

Highlighted

Re: Linux client startup very slow

Rock Star 16
Rock Star 16

This is a brilliant solution, and it could also help those on Windows/Mac too, as long as sqlite is installed.

Good job and thank you for this @dr_barnowl 🌟

SebastyRock Star 16
Help others find this answer and click "Accept as Solution".
If you appreciate my answer, maybe give me a Like.
Note: I'm not a Spotify employee.
Highlighted

Re: Linux client startup very slow

Casual Listener

> how did you do that?

 

It's not my first brush with sqlite databases ; they're also used for profile data in Firefox, and as the data/settings store in a lot of Android projects, and as "test" databases for a lot of projects (before you graduate to a grown-up database server). I think it Firefox offers to clean them up and vacuum every couple of major versions now, but there was an extension that did the vacuum for you a while back, and that's why I'm familiar with the term.

 

Lots of software takes the convention of naming them `*.db`, and even if they don't, Linux has great filetype detection tools ...

 

    ❯ file mercury.db
    mercury.db: SQLite 3.x database, last written using SQLite version 3016002

 

Or if you open it in a hex editor, the first few bytes say "SQLite format version 3".

 

I can't tell for sure, but the word "VACUUM" doesn't seem to appear anywhere in the Spotify client binary except from where it's statically linked as part of the SQLite libraries, so I don't know if it ever vacuums. But it doesn't seem like it. It deletes entries from the storage table as they drop out of your assigned cache space, so that will cause fragmentation.

SUGGESTED POSTS