Using Android App Causes subsonic-service.exe to 100% CPU

Need help? Post your questions here.

Moderator: moderators

Postby tguless » Thu Jul 29, 2010 12:24 am

I should also add that the server requires a restart after replacing these files.
tguless
 
Posts: 26
Joined: Fri Jul 23, 2010 6:22 pm

Postby blinkfink182 » Thu Jul 29, 2010 1:12 am

Again, you are the man. I'll download those tonight and give it a shot. I'll let you know tomorrow how it goes.

Thanks again. This is why open source is the way to be. :P
blinkfink182
 
Posts: 12
Joined: Thu Jul 22, 2010 2:07 pm
Location: Chicago

Postby blinkfink182 » Thu Jul 29, 2010 12:46 pm

The new files appear to have made it worse. Now it is constantly using as much CPU as it can from startup and there must be a memory leak somewhere as now the memory usage in over 400MB, when it i usually well under 100MB. In the log in the webapp, I see entries like this, over and over and over again. Any ideas?

Code: Select all
[7/29/10 7:38:56 AM CDT]   INFO   RESTController   Before searchService
[7/29/10 7:39:08 AM CDT]   INFO   RESTController   Before searchService
[7/29/10 7:39:20 AM CDT]   INFO   RESTController   Before searchService
[7/29/10 7:39:35 AM CDT]   INFO   RESTController   After searchService
[7/29/10 7:39:40 AM CDT]   INFO   RESTController   Before searchService
[7/29/10 7:39:52 AM CDT]   INFO   RESTController   Before searchService
[7/29/10 7:40:05 AM CDT]   INFO   RESTController   Before searchService
[7/29/10 7:40:17 AM CDT]   INFO   RESTController   Before searchService
[7/29/10 7:40:29 AM CDT]   INFO   RESTController   After searchService
[7/29/10 7:40:29 AM CDT]   INFO   RESTController   Before searchService
[7/29/10 7:40:48 AM CDT]   INFO   RESTController   After searchService
[7/29/10 7:40:50 AM CDT]   INFO   RESTController   Before searchService
[7/29/10 7:41:02 AM CDT]   INFO   RESTController   Before searchService
[7/29/10 7:41:02 AM CDT]   INFO   RESTController   After searchService
[7/29/10 7:41:04 AM CDT]   INFO   RESTController   After searchService
[7/29/10 7:41:14 AM CDT]   INFO   RESTController   Before searchService
[7/29/10 7:41:26 AM CDT]   INFO   RESTController   Before searchService
[7/29/10 7:41:39 AM CDT]   INFO   RESTController   Before searchService
[7/29/10 7:41:53 AM CDT]   INFO   RESTController   After searchService
[7/29/10 7:41:59 AM CDT]   INFO   RESTController   Before searchService
[/code]
blinkfink182
 
Posts: 12
Joined: Thu Jul 22, 2010 2:07 pm
Location: Chicago

Postby tguless » Thu Jul 29, 2010 12:50 pm

Ok just noticed server this morning was again unresponsive.

The call has been sped up, but I don't think it's enough:

[2010-07-29 08:35:32,427] INFO RESTController - Before searchService
[2010-07-29 08:35:32,428] INFO SearchService - begin getIndex()
[2010-07-29 08:35:32,428] INFO SearchService - end getIndex()
[2010-07-29 08:35:32,428] INFO SearchService - begin iterationLoop()
[2010-07-29 08:35:39,393] INFO SearchService - end iterationLoop()
[2010-07-29 08:35:48,202] INFO RESTController - After searchService


Now only takes 16 seconds to complete, but android makes a call to this script every 12. So it still bogs down the server. I wish there was a way to change the time out period on the android app.

192.168.35.1 - - [26/Jul/2010:11:36:15 -0400] "GET /subsonic/rest/getRandomSongs.view?u=admin&p=enc:686169673234&v=1.2.0&c=android&size=100 HTTP/1.1" 502 571 "-" "-"

192.168.35.1 - - [26/Jul/2010:11:36:28 -0400] "GET /subsonic/rest/getRandomSongs.view?u=admin&p=enc:686169673234&v=1.2.0&c=android&size=100 HTTP/1.1" 502 571 "-" "-"

192.168.35.1 - - [26/Jul/2010:11:36:40 -0400] "GET /subsonic/rest/getRandomSongs.view?u=admin&p=enc:686169673234&v=1.2.0&c=android&size=100 HTTP/1.1" 502 571 "-" "-"
tguless
 
Posts: 26
Joined: Fri Jul 23, 2010 6:22 pm

Postby tguless » Thu Jul 29, 2010 1:13 pm

Ok also changed line 496

From:
size = Math.max(0, Math.min(size, 500));

To:
size = Math.max(0, Math.min(size, 25));

This sets the upper limit of the getRandomSongs call to 25 instead of 500.

The call from the android phones requests 100 songs. Now this will only return 25 songs.

I've updated the files, please grab a fresh copy

The call is much faster now:

[2010-07-29 09:02:29,507] INFO RESTController - Before searchService
[2010-07-29 09:02:35,336] INFO RESTController - After searchService

Completes in 6 seconds. Should not bog down the server, unless there are alot of these coming in.

Ted
tguless
 
Posts: 26
Joined: Fri Jul 23, 2010 6:22 pm

Postby tguless » Thu Jul 29, 2010 1:35 pm

Also set an upper limit of 5 for the random albums query. So now the random function on android works for me.

The http call looks like this:

/subsonic/rest/getAlbumList.view?u=admin&p=enc:686169673234&v=1.2.0&c=android&type=random&size=20&offset=0

The lines I changed are around line 463 in the file RESTController.java

} else {
size = Math.max(0, Math.min(size, 5));
albums = homeController.getRandom(size);
}

Again I've posted updates, and again please grab fresh copies of the 3 files from my server and test.

Thanks,
Ted
tguless
 
Posts: 26
Joined: Fri Jul 23, 2010 6:22 pm

Postby blinkfink182 » Thu Jul 29, 2010 3:46 pm

THERE IT IS!

Nailed it man, all is good now. Thanks again, so so so much.

Everyone with this issue, grab the files linked in the last post on page one. Resolves the issue.
blinkfink182
 
Posts: 12
Joined: Thu Jul 22, 2010 2:07 pm
Location: Chicago

Postby tguless » Thu Jul 29, 2010 4:21 pm

Just curious, do you have 3 android clients configured to connect to your server?

According to those last logs, your server was getting hammered with repeating random song list requests. I think the Android client needs cleanup as well. If I have time I'll dig into that code as well. But I think my volunteer time is better spent in addressing the server performance issues.

This project has so much potential. It is very well written, and I love how self contained it is. I can learn alot from this.

I'm a huge fan.
tguless
 
Posts: 26
Joined: Fri Jul 23, 2010 6:22 pm

Postby Gabriel1964 » Thu Jul 29, 2010 9:54 pm

Thank you, was totally flumexed as to why my whs was running at 100% utilisation of the cpu. This fixed it.

much appreciated
Gabriel1964
 
Posts: 1
Joined: Thu Jul 29, 2010 9:52 pm

Postby blinkfink182 » Tue Aug 03, 2010 2:24 pm

@tgluess:

Nope, just my one phone, no other Android clients.
blinkfink182
 
Posts: 12
Joined: Thu Jul 22, 2010 2:07 pm
Location: Chicago

Just fixed another issue...

Postby tguless » Wed Aug 04, 2010 7:03 pm

Redownload the same 3 files from the same URL. The new fix will actually fix the file browser so you can browse your folders. With my large collection it was timing out. I removed the coverart data population calls, and it is actually functional now. I just don't see coverarts in that section, which is fine by me.
tguless
 
Posts: 26
Joined: Fri Jul 23, 2010 6:22 pm

Postby sindre_mehus » Thu Aug 05, 2010 2:16 pm

Hi all,

Thanks for bringing this to my attention. I will optimize this code in the next Subsonic release.

Thanks again,
Sindre
Subsonic developer
User avatar
sindre_mehus
 
Posts: 1955
Joined: Tue Nov 29, 2005 6:19 pm
Location: Oslo, Norway

Re: Just fixed another issue...

Postby lpadron » Wed Aug 25, 2010 8:29 pm

tguless wrote:Redownload the same 3 files from the same URL. The new fix will actually fix the file browser so you can browse your folders. With my large collection it was timing out. I removed the coverart data population calls, and it is actually functional now. I just don't see coverarts in that section, which is fine by me.


tguless, Thanks!!!!

I suddenly started getting 100% util on SS the past few days (after 4 months use) on my XP PC. Downloaded your class files and they did the trick!!! Thanks for the edits. Proves the value OPEN SOURCE!!!
lpadron
 
Posts: 17
Joined: Thu Jun 03, 2010 6:00 pm

I haven't pulled the latest source to see if it's in trunk

Postby tguless » Fri Apr 08, 2011 12:10 am

But looking at the changelog history:

http://www.subsonic.org/pages/changelog.jsp

Under the heading Subsonic 4.1.beta1 - Aug 21, 2010

There's an item titled:
Performance: Faster coverart lookup.

I am still running an old version in fear of having slow performance again, also the Ubuntu repository version seems to still be 4.0.1

apt-cache show subsonic

Package: subsonic
Status: install ok installed
Priority: optional
Section: Multimedia
Maintainer: Sindre Mehus <sindre@activeobjects.no>
Architecture: all
Version: 4.0.1
Recommends: lame, flac, faad, vorbis-tools, ffmpeg
Conffiles:
/etc/default/subsonic d539125930bb47f8075b4c35e429b214
Description: A web-based music streamer, jukebox and Podcast receiver
Subsonic is a web-based music streamer, jukebox and Podcast receiver,
providing access to your music collection wherever you are. Use it
to share your music with friends, or to listen to your music while away
from home.
.
A Subsonic client for Android phones is also available.
.
Java 1.6 or higher is required to run Subsonic.
.
Subsonic can be found at http://subsonic.org
tguless
 
Posts: 26
Joined: Fri Jul 23, 2010 6:22 pm

Previous

Return to Help

Who is online

Users browsing this forum: No registered users and 58 guests