Page 1 of 2

Delay after logging in Large Music Collection

PostPosted: Fri Jul 06, 2007 4:42 pm
by kapz
I recently increased my music collection by 65gigs (about 800 new folders) and now there is a noticeable delay in displaying the home page after logging in. Using IE6 (or Firefox), it takes about 20 seconds for the page to be displayed. I am running on a 2.8Ghz (Intel with Hyperthreading) with 1gig of ram (one of my older computers I use for subsonic only).

This slight delay is not a problem on a normal computer, but I suspect it has something to do with the browser timing out when logging into the WAP interface on my Sprint Treo 700P cell phone. After I login, the browser times out and I simply can not get to the WAP start page. Maybe a faster server would help. Is Subsonic scanning all the folders when a new session starts? If this is the case, could a song index/cache be used for WAP? I want to note that my subsonic server reads the music off a file server a few feet away (probably degrades performance a bit). You really need to scan for new folders on new sessions. I don’t think you can do much to help this, but I didn’t think it would hurt to ask :)

Current Subsonic Specs:
3,959 artists
1,895 albums
24,654 songs
140.59 GB (~ 2,183 hours)

I am using Subsonic v3.1 beta 1. BTW, the left panel Brower caching works very well.

PostPosted: Fri Jul 06, 2007 8:56 pm
by sindre_mehus
Hi,

20 seconds sounds like a lot, even for a big collection like yours. The fact that it's residing on a network disk is probably the main reason why it's so slow.

When accessing the main page the entire music folder is not recursively scanned, but all the directories on the top level is listed (typically there is one directory per artist). Over a network connection, this listing might take quite some time.

It would be perfectly feasable to optimize this by caching and prefetching directories. I've added a todo item on this, so hopefully it will be improved in a future release.

Thanks for your input,
Sindre

PostPosted: Sat Jul 07, 2007 12:03 am
by kapz
Thanks. I have cable modem access and at work Subsonic paused for 48sec after Login was clicked and took another 20sec for the Left panel to populate.

Its not a big deal when on a PC. Once the page is cached Subsonic preforms great even with 3-4 people streaming at 56kbs (I have an upload limit of ~45KB/s).

The new collection added roughly 800 directories (artists). There was no delay at all before, so I assumed it was due to the extra directories. I am a webapp programmer too and tend to keep my main (production) system clean of tasks a server can do.

What I like about Subsonic is I can throw a new album in on of the Music Folders and its instantly available to me. You will still need to scan the top level directories on new sessions, right?

PostPosted: Sat Jul 07, 2007 6:53 am
by sindre_mehus
Hi,

I can use the last-modified date of the root music folder(s) to detect if there has been any removal or addition of immediate sub-directories. Most of the time there will be no changes, so I can use the cached data. Otherwise, I need to rescan.

I also like the feature that changes on the disk are immediately reflected in Subsonic, so I won't "mess" with that :-)

Cheers,
Sindre

PostPosted: Sun Jul 08, 2007 7:09 pm
by sindre_mehus
I have some good news. I've optimized the code which scans the music folders, and for network disks it is now five times faster (on my system).

More importantly, the content of the root music folders are now cached, so subsequent accesses take virtually no time. The cache is invalidated and recreated if sub-directories are added or deleted.

Cheers,
Sindre

PostPosted: Mon Jul 09, 2007 5:18 am
by kapz
Awsome, Thank you so much.

Will this be in the next release?

PostPosted: Mon Jul 09, 2007 1:49 pm
by sindre_mehus
Sure. I will make a second beta release in not so long.

PostPosted: Mon Jul 09, 2007 6:29 pm
by RXWatcher
I'm also seeing a long delay when loading a HUGE playlist..a little under 5000
songs. I think subsonic is going through the playlist song by song and querying the files for their tag info(format, album, bitrate, etc). Is there a way to maybe queue the lookups behind the scenes or save them from a previous lookup(when the playlist was last saved maybe?). I can probably turn off some of the display info and see if that speeds it up.

thanks for the help.

PostPosted: Tue Jul 10, 2007 5:54 am
by kapz
Maybe the playlist could utilize the cache also.

PostPosted: Wed Jul 11, 2007 7:02 pm
by sindre_mehus
There is actually already a memory cache for song files in order to reduce disc traffic. However, it only caches up to 1000 files, so it won't help if you have a playlist with 5000 entries.

Sindre

PostPosted: Wed Jul 11, 2007 7:32 pm
by RXWatcher
Is there we can increase this? Maybe in a config file? I can dedicate as much as 800 MB of memory to tomcat if we need it.

PostPosted: Tue Nov 11, 2008 12:21 pm
by fecalmummy
I would also appreciate configuration options and suggestions for optimizing performance.

When viewing album, changing to the next one using the links below the track list tends to take around 3-5 seconds, which I think is a bit on the slow side.

Good job nonetheless.

PostPosted: Thu Nov 13, 2008 6:10 am
by mixmaster
I basically brought subsonic to its knees just now. I was only playing of off playlists I imported. When I clicked some of my less large but still large collections, it would take a long time to load the page with all the album covers. CPU would spike to 50 percent (seems to be only taxing one CPU thankfully). I was playing a playlist in the flash player and clicked on my Rock-Pop colleciton (283 GB, 1133 artists) it basically stopped playing after the next song finished, and then the web browser's tab became unresponsive. The CPU went down so the server side work finished, but if you click on Rock-Pop and it kills the app, it kind of kills the point.
________

PostPosted: Thu Nov 13, 2008 7:57 am
by sindre_mehus
mixmaster wrote:I was playing a playlist in the flash player and clicked on my Rock-Pop colleciton (283 GB, 1133 artists) it basically stopped playing after the next song finished, and then the web browser's tab became unresponsive. The CPU went down so the server side work finished, but if you click on Rock-Pop and it kills the app, it kind of kills the point.


Am I correct in assuming that your music is organized something like this?

Code: Select all
/music
   /rockpop
       /artistA
       /artistB
   /jazz
       /artistC
       /artistD
   /classic
       /artistE
       /artistF


If so, Subsonic would probably work better if you define multiple music folders, one for each subcollection: /music/rockpop, /music/jazz, /music/classic.

Then you will have artists along the left column, and clicking an artist will show its albums etc.

Hope this helps,
Sindre

PostPosted: Thu Nov 13, 2008 4:43 pm
by mixmaster
Thanks Sindre, I was afriad that I would lose the ability to look at the collections individually, but the dropdown at the top shows each collection. Thanks for the help and good design.
________