PDA

View Full Version : Slimserver CPU consumption



jallison
2006-03-03, 13:47
I'm an "original Squeezebox" owner but just recently moved to version 6.2.1 of the server. I've noticed the server process racking up massive amounts of CPU time and typically running at 95%+ of available CPU. For example, after restarting the service last night, as of late this morning the slim service had accumulated over 14 hours of CPU time.

It's not scanning during all this time, or at least the web interface does not indicate that scanning is going on. I've looked for loops in my music library, but there are no shortcuts at all on the disk that holds my music. I do have a few "smart" playlists in iTunes; I don't know if those cause trouble. I'm really wondering what the server is doing with all this time.

As mentioned, this is v 6.2.1 of the server. Windows XP. Using iTunes. Older PC (1.2 Ghz CPU), 1/2 gig of RAM. 6797 songs according to iTunes (Squeezebox reports 6819).

Anyone have any thoughts on what the server might be trying to do? Thanks.

- Jeff

Michaelwagner
2006-03-03, 15:43
Should have been done in about half an hour or less on that hardware. Something is definitely wrong.

James
2006-03-03, 15:52
Have you been doing anything in iTunes?
Do you have iTunes podcasts that are automatically updated?
Could be the iTunes rescan running almost continuously.

Although if you can see the number of songs in the SlimServer library that should indicate the scan is not running?

James

jallison
2006-03-03, 17:10
Have you been doing anything in iTunes?
Do you have iTunes podcasts that are automatically updated?
Could be the iTunes rescan running almost continuously.

Although if you can see the number of songs in the SlimServer library that should indicate the scan is not running?

James

I don't think it's the scan, for the reason you point out -- the songs/artists/albums information is displayed rather than the "still scanning" message.

I should also point out that this is not continuous. I can stop and restart the service and this has cleared it up...but not always. So it's intermittent and I haven't figured out what the driver is.

gbreit
2006-03-03, 18:27
I don't think it's the scan, for the reason you point out -- the songs/artists/albums information is displayed rather than the "still scanning" message.

I should also point out that this is not continuous. I can stop and restart the service and this has cleared it up...but not always. So it's intermittent and I haven't figured out what the driver is.

I got nailed by something like this when I was doing a lot of library management with iTunes. Especially if I renamed artists, changed albums from belonging to compilations to not, and vice versa. I am not 100% sure why it happened, but I suspect it was due to iTunes renaming or moving directories in my music library.

This appeared to confuse Slimserver. I was getting high cpu usage and started seeing duplicate songs in Slimserver (maybe why you have a mismatch of song counts?). I also frequently saw the known bug where "now playing" falls behind what is actually playing.

Now, whenever I do any management in iTunes, I force a "Clear and rescan library" in Slimserver. I also switched back to the Default skin from ExBrowse3. Those two changes seemed to help a lot, although I still occasionally see the "now playing" bug if I am doing other things on my server PC (roughly the same specs as yours).

HTH.

gb

ikeb
2006-03-04, 07:59
i've had the same problem on a pentium 4 (2.4mhz) with 512 meg and windows xp.

i have changed to settings to not install flac and a few other things. My 100% cpu usage occured mostly when slimserver lost the connection to a radio station - looks like the programmers don't know how to timeout an endless loop. I found the problem when i ran itunes on a different computer and had it set to the same radio station as slimserver. Ituenes would try 3 times to get the station back and then give up - slimserver just went into an endless loop to get the station back.

Deleteing flac and other items i don't need in settings helped also.

All of my music is in apple lossless. I use slimserver 3 wireless.

One last thing - slimserver is not a very good program in my opinion. I believe it is an amateur hack - the program should have been written in C++ by pros and screw all the other operating systems. windows has 96% of the os business and slimdevices is trying to be compatible with the other 4% - doesn't make sense.

jallison
2006-03-05, 16:40
Thanks to all who replied. I tend to think that the comment on iTunes moving things around may be on track. Anyone have any suggestions or best practices for running SlimServer with iTunes?

gbreit
2006-03-07, 14:54
This isn't necessarily a "best practice", but merely what works for me.

I use the "Keep iTunes Music folder organized" option under "Preferences-Advanced" in iTunes. Sure, I could do the organization myself by creating subdirs, etc., but this feature is too convenient and I am too lazy, so I use it.

Downside of this is that iTunes makes changes to the library dir/file structure any time you:

-- Change a song title
-- Change an album title
-- Change an artist name
-- Mark/unmark an album as "Part of a compilation".
-- Change track/disc number

Unfortunately, I find this frequently necessary because of errors in the CDDB database.

So, trouble with SlimServer happens under the following scenario:

-- You import a CD using iTunes
-- SlimServer scans that new entry (I believe by reading the iTunes .xml library file, not sure if these are entered into the Slim tag database but I think so)
-- You make one of the changes above in iTunes
-- SlimServer rescans your iTunes library

What happens to me in this case is that SlimServer will show duplicate song titles. Inspecting the file info shows that one of these is a pointer to the original song file/path, which no longer exists. As far as I could tell, this is what was causing my occasional high CPU usage. There is a reference to this general scenario in the Troubleshooting section of the FAQ:

http://www.slimdevices.com/su_faq.html#troubleshooting-lockup

Adding music in iTunes doesn't cause a problem. Creating/changing playlists doesn't cause a problem. Changing other iTunes song info like rating, comments, etc. doesn't cause a problem since Slim doesn't consider these without additional plugins.

So, the safest thing is if you have been doing library management in iTunes, force a "Clear and rescan library" in SlimServer. Only by doing this will it remove the broken pointers to non-existent files. With a big library, it takes a while, so I usually do it before I turn in for the night.

HTH. I haven't seen this exact discussion before, but that FAQ entry really helped me sort things out.

gb

Fred
2006-03-07, 17:34
There is a setting as well that controls how often SlimServer checks for changes in the iTunes XML file, you may want to increase it. Otherwise the first change in iTunes triggers a rescan, but since you are still changing things in iTunes it will start again as soon as the rescan finishes.

I also think I noticed cases where scanning was in progress despite the server not mentioning it in the GUI. And this can lead to some issues in rescan control...

So I would suggest this to get back on tracks, or whenever you do major iTunes housekeeping:
- Stop slimserver
- Delete caches
- Do whatever you need to do in iTunes, then quit it
- Launch Slimserver
- It will rebuild the DB, this takes some time.

Also make sure that the directory for files set on the server matches your iTunes library or is empty, otherwise the server sometimes try to scan both.

With 6.2.1 and a large library, iTunes interfacing is not really "seamless".

Fred

Fred
2006-03-07, 17:53
One last thing - slimserver is not a very good program in my opinion. I believe it is an amateur hack - the program should have been written in C++ by pros and screw all the other operating systems. windows has 96% of the os business and slimdevices is trying to be compatible with the other 4% - doesn't make sense.

The API of the Squeezebox is available. This means you're entirely free to do or even sell a C++ Windows program "made by pros" to drive the SqueezeBox. The "amateur hackers" will even answer all your questions in the Dev forum.

gbreit
2006-03-07, 18:36
With 6.2.1 and a large library, iTunes interfacing is not really "seamless".

Fred
Agreed. That said, I am happy that the iTunes integration works as well as it does. My wife loves her iPod so this is the best solution for us. Fortunately (?) I am the one who does the bulk of the ripping and library management so I just take care of this stuff. She doesn't have to worry about it.

Perhaps some of this accumulated knowledge should be added to the wiki. It's not quite as easy as this suggests:

http://wiki.slimdevices.com/index.cgi?BeginnersGuideToOrganising

This one doesn't really get into the issues we have discussed:

http://wiki.slimdevices.com/index.cgi?BeginnersGuideToiTunes

It may take me a few days to get to it, but I'll try to pull something together.

gb

jallison
2006-03-08, 08:04
Thanks to all who've weighed in on this thread. I have adopted the turn
Slimserver off/manage iTunes/turn Slimserver on approach. I still see
the occasional runaway case, but restarting the service seems to clear that.

- Jeff

gbreit wrote:
> Fred Wrote:
>> With 6.2.1 and a large library, iTunes interfacing is not really
>> "seamless".
>>
>> Fred
> Agreed. That said, I am happy that the iTunes integration works as well
> as it does. My wife loves her iPod so this is the best solution for us.
> Fortunately (?) I am the one who does the bulk of the ripping and
> library management so I just take care of this stuff. She doesn't have
> to worry about it.
>
> Perhaps some of this accumulated knowledge should be added to the wiki.
> It's not quite as easy as this suggests:
>
> http://wiki.slimdevices.com/index.cgi?BeginnersGuideToOrganising
>
> This one doesn't really get into the issues we have discussed:
>
> http://wiki.slimdevices.com/index.cgi?BeginnersGuideToiTunes
>
> It may take me a few days to get to it, but I'll try to pull something
> together.
>
> gb
>
>