Subsonic Forum Forum Index Subsonic Forum

 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   SmartFeedSmartFeed   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Caching system for artists list ?

 
Post new topic   Reply to topic    Subsonic Forum Forum Index -> Feature Requests
View previous topic :: View next topic  
Author Message
Matts



Joined: 15 Nov 2008
Posts: 10

PostPosted: Sat Feb 07, 2009 4:24 pm    Post subject: Caching system for artists list ? Reply with quote

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...
Back to top
View user's profile Send private message
sindre_mehus



Joined: 29 Nov 2005
Posts: 1138
Location: Oslo, Norway

PostPosted: Sun Feb 08, 2009 6:20 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message Visit poster's website
kdid



Joined: 02 Jan 2007
Posts: 116

PostPosted: Thu Mar 05, 2009 10:26 pm    Post subject: Multiple music folder problem Reply with quote

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
Back to top
View user's profile Send private message
sindre_mehus



Joined: 29 Nov 2005
Posts: 1138
Location: Oslo, Norway

PostPosted: Sun Mar 08, 2009 8:32 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message Visit poster's website
sindre_mehus



Joined: 29 Nov 2005
Posts: 1138
Location: Oslo, Norway

PostPosted: Sat Mar 14, 2009 8:45 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message Visit poster's website
aphuey



Joined: 17 Nov 2008
Posts: 101

PostPosted: Mon Mar 16, 2009 3:43 pm    Post subject: Reply with quote

Awesome improvement! Thanks for all your work, Sindre!
Back to top
View user's profile Send private message
zeekay



Joined: 03 Aug 2008
Posts: 63

PostPosted: Wed Mar 25, 2009 11:01 pm    Post subject: Reply with quote

Wow, that sounds great sindre, any news on when the new beta will drop?
Back to top
View user's profile Send private message
kdid



Joined: 02 Jan 2007
Posts: 116

PostPosted: Mon Mar 30, 2009 10:26 am    Post subject: Reply with quote

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

Do you know if this also will work if you use UNC paths to the music folders?
_________________
-- kdid
Back to top
View user's profile Send private message
sindre_mehus



Joined: 29 Nov 2005
Posts: 1138
Location: Oslo, Norway

PostPosted: Mon Mar 30, 2009 10:40 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message Visit poster's website
mason



Joined: 07 Apr 2009
Posts: 10

PostPosted: Tue Apr 07, 2009 12:21 pm    Post subject: Reply with quote

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 Smile
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Subsonic Forum Forum Index -> Feature Requests All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group