Caching system for artists list ?

Got an idea? Missing something? Post your feature request here.

Moderator: moderators

Caching system for artists list ?

Postby Matts » Sat Feb 07, 2009 4:24 pm

Hello !

My Subsonic is running on an old computer (Athlon 700Mhz, 512Mb of RAM) and as I have a noticeable amount of artists in my collection, displaying the artists list takes about 15 seconds...

It's not that annoying, considering the fact that the artists list is on a frame, and thus is loaded only once, when I open subsonic, but still...

I was wondering if it would be possible to have a caching system for the artist list, updated daily ?

This way, loading subsonic would be instantaneous...
Matts
 
Posts: 18
Joined: Sat Nov 15, 2008 2:07 pm

Postby sindre_mehus » Sun Feb 08, 2009 6:20 am

Hi,

This is already cached. Given that you don't restart Subsonic, and don't modify the (timestamp of the) music folder(s), Subsonic will not read from disk when creating the artist list.

Also, is supports HTTP "last-modified" to facilitate browser caching.

Sindre
User avatar
sindre_mehus
 
Posts: 1954
Joined: Tue Nov 29, 2005 6:19 pm
Location: Oslo, Norway

Multiple music folder problem

Postby kdid » Thu Mar 05, 2009 10:26 pm

Using your excellent software I just discovered a related problem. If you have multiple music folders for Subsonic and you switch between them using the dropdown box at the top of the artist list, then it looks like Subsonic will generate a new artist list from scratch. When doing that it also looks like it is accessing the file structure on disk instead of using a internal cache for the artists that is in each list.

Normally this is not a big problem, it is noticable, but only barely.

But if you have the files on a different machine, so that it need to access the filestructure over the local network, then going between folders in the said dropdown list becomes painfully slow.

I have a setup at home now with Subsonic on one PC and all the music files is on that same PC. Going between music folders there is quite snappy.

In addition I installed Subsonic on a different PC. This PC is accessing the music files over the local network at the machine mentioned above. Going between music folders on this machine is painfully slow. To get up the full artist list takes over a minute. And if you pick another folder in the dropdown list, it takes less time since there is less folders to scan. But if you again go back to the full artist list, then it again takes a long time. When I tested it now it did it in 45 seconds.

The important part here is that each of these folders should had a cached list of artists, and that the cache should had been made when Subsonic did start and then should had been maintained as you describe above throught timestamp notification.

Without a fix for this, you will have serious problems by having the music files on a NAS and running Subsonic on a different machine.

I will send you a PM with login info on my two instances of Subsonic so that you can get a feel of what I'm talk about.


EDIT. But a good workaround for me for now is to keep the music on the same machine as Subsonic. This time I was merely testing how such a setup would work.

As always, I'm greateful for the effort you put into Subsonic. Keep up the good work.
-- kdid
kdid
 
Posts: 131
Joined: Tue Jan 02, 2007 11:17 am

Postby sindre_mehus » Sun Mar 08, 2009 8:32 am

kdid,

Thanks for your extensive report and for giving me access to your server which so clearly demonstrates the problem.

I hope to get time to look deeper into this in the coming week.

Sindre
User avatar
sindre_mehus
 
Posts: 1954
Joined: Tue Nov 29, 2005 6:19 pm
Location: Oslo, Norway

Postby sindre_mehus » Sat Mar 14, 2009 8:45 pm

Good news!

I spent a whole day optimizing this, and it should be pretty good now.

First of all, browser caching is a lot better, meaning that the artist list in most cases doesn't even have to be transmitted. It will only be sent if one of the following is true:

o It's not in the browser cache.
o The selected music folder has changed on disk.
o Certain settings have changed (such as theme, language, music folder definitions, internet radio settings).

Secondly, the artist list is also cached server-side. This cache is even persisted, and will survive server restarts.

Starting from Subsonic 3.7, this should hopefully eliminate a lot of disk traffic.

One potential optimization I haven't done is pre-populating the cache at start-up and/or at regular intervals.
User avatar
sindre_mehus
 
Posts: 1954
Joined: Tue Nov 29, 2005 6:19 pm
Location: Oslo, Norway

Postby aphuey » Mon Mar 16, 2009 3:43 pm

Awesome improvement! Thanks for all your work, Sindre!
aphuey
 
Posts: 102
Joined: Mon Nov 17, 2008 6:25 pm

Postby zeekay » Wed Mar 25, 2009 11:01 pm

Wow, that sounds great sindre, any news on when the new beta will drop?
zeekay
 
Posts: 63
Joined: Sun Aug 03, 2008 6:33 pm

Postby kdid » Mon Mar 30, 2009 10:26 am

Thanks Sindre. This sounds like it will really speed up browsing. I look forward to 3.7. :-)

Do you know if this also will work if you use UNC paths to the music folders?
-- kdid
kdid
 
Posts: 131
Joined: Tue Jan 02, 2007 11:17 am

Postby sindre_mehus » Mon Mar 30, 2009 10:40 am

kdid wrote:Do you know if this also will work if you use UNC paths to the music folders?

I haven't tested that, but as long as the last modified timestamp is correct for those folders, it should work just fine.
User avatar
sindre_mehus
 
Posts: 1954
Joined: Tue Nov 29, 2005 6:19 pm
Location: Oslo, Norway

Postby mason » Tue Apr 07, 2009 12:21 pm

nice to hear, since im hitting the same problems with a hughe filebase!

im really glad i found your app and if i finaly decide to use it ... you will get one more happy donor on your side :)
User avatar
mason
 
Posts: 27
Joined: Tue Apr 07, 2009 12:13 pm


Return to Feature Requests

Who is online

Users browsing this forum: No registered users and 2 guests