rembo10 / headphones

Automatic music downloader for SABnzbd
GNU General Public License v3.0
3.35k stars 602 forks source link

80% of cpu #645

Closed zoic21 closed 10 years ago

zoic21 commented 12 years ago

I have two problems with headphones :

What can I do to help you to solve this.

rembo10 commented 12 years ago

Its not really doing anything too CPU intensive ever. Mine uses like 2% of an atom n270

Not sure about the auto shutdown either..... let me think about what might be happening On May 25, 2012 5:34 PM, "zoic21" < reply@reply.github.com> wrote:

I have two problems with headphones :

  • sometimes headphones use 80% of cpu (2 cores at 2.4ghz) and lot of memory
  • and sometimes headphones auto shutdown I don't know why there is nothing in log

What can I do to help you to solve this.


Reply to this email directly or view it on GitHub: https://github.com/rembo10/headphones/issues/645

zoic21 commented 12 years ago

Here log when heaphone used 80% of cpu :

25-mai-2012 11:24:41 - INFO :: MainThread : Headphones is already up-to-date. 25-mai-2012 11:24:41 - INFO :: MainThread : Starting Headphones on port: 8181 25-mai-2012 11:48:48 - INFO :: CP Server Thread-6 : Recieved API command: getIndex 25-mai-2012 15:45:53 - INFO :: CP Server Thread-10 : Recieved API command: getIndex 25-mai-2012 15:45:56 - INFO :: CP Server Thread-11 : Recieved API command: getArtist 25-mai-2012 16:24:42 - INFO :: Thread-72 : Headphones is already up-to-date. 25-mai-2012 16:24:52 - INFO :: Thread-71 : Scanning music directory: /home/data/Audio/ 25-mai-2012 16:50:10 - INFO :: MainThread : Checking to see if the database has all tables.... 25-mai-2012 16:50:10 - DEBUG :: MainThread : Trying to execute: "git rev-parse HEAD" with shell in /home/www/vhosts/headphones.darkserver.fr 25-mai-2012 16:50:10 - DEBUG :: MainThread : Git output: c83477d5414f0415591800b90e30d7f84397d429

25-mai-2012 16:50:11 - INFO :: MainThread : Headphones is already up-to-date. 25-mai-2012 16:50:11 - INFO :: MainThread : Starting Headphones on port: 8181

At 16:50 I restart it.

rembo10 commented 12 years ago

Okay, so its getting stuck while doing the library scan. It shouldn't be that CPU intensive. Lemme look over the code On May 25, 2012 8:30 PM, "zoic21" < reply@reply.github.com> wrote:

Here log when heaphone used 80% of cpu :

25-mai-2012 11:24:41 - INFO :: MainThread : Headphones is already up-to-date. 25-mai-2012 11:24:41 - INFO :: MainThread : Starting Headphones on port: 8181 25-mai-2012 11:48:48 - INFO :: CP Server Thread-6 : Recieved API command: getIndex 25-mai-2012 15:45:53 - INFO :: CP Server Thread-10 : Recieved API command: getIndex 25-mai-2012 15:45:56 - INFO :: CP Server Thread-11 : Recieved API command: getArtist 25-mai-2012 16:24:42 - INFO :: Thread-72 : Headphones is already up-to-date. 25-mai-2012 16:24:52 - INFO :: Thread-71 : Scanning music directory: /home/data/Audio/ 25-mai-2012 16:50:10 - INFO :: MainThread : Checking to see if the database has all tables.... 25-mai-2012 16:50:10 - DEBUG :: MainThread : Trying to execute: "git rev-parse HEAD" with shell in /home/www/vhosts/headphones.darkserver.fr 25-mai-2012 16:50:10 - DEBUG :: MainThread : Git output: c83477d5414f0415591800b90e30d7f84397d429

25-mai-2012 16:50:11 - INFO :: MainThread : Headphones is already up-to-date. 25-mai-2012 16:50:11 - INFO :: MainThread : Starting Headphones on port: 8181

At 16:50 I restart it.


Reply to this email directly or view it on GitHub: https://github.com/rembo10/headphones/issues/645#issuecomment-5932295

zoic21 commented 12 years ago

Hi, Headphones has restarted again, here the last line log : 31-mai-2012 00:06:30 - INFO :: Thread-84 : Headphones is already up-to-date. 31-mai-2012 02:20:36 - INFO :: Thread-71 : Completed scanning of directory: /home/data/Audio/ 31-mai-2012 02:20:36 - INFO :: Thread-71 : Checking filepaths to see if we can find any matches 31-mai-2012 04:06:30 - INFO :: Thread-133 : Scanning music directory: /home/data/Audio/ 31-mai-2012 06:06:31 - INFO :: Thread-158 : Headphones is already up-to-date. 31-mai-2012 07:20:05 - INFO :: Thread-133 : Completed scanning of directory: /home/data/Audio/ 31-mai-2012 07:20:05 - INFO :: Thread-133 : Checking filepaths to see if we can find any matches 31-mai-2012 09:06:48 - INFO :: Thread-195 : Scanning music directory: /home/data/Audio/ 31-mai-2012 12:06:31 - INFO :: Thread-232 : Headphones is already up-to-date. 31-mai-2012 12:20:22 - INFO :: Thread-195 : Completed scanning of directory: /home/data/Audio/ 31-mai-2012 12:20:22 - INFO :: Thread-195 : Checking filepaths to see if we can find any matches 31-mai-2012 14:06:39 - INFO :: Thread-257 : Scanning music directory: /home/data/Audio/ 31-mai-2012 17:19:16 - INFO :: Thread-257 : Completed scanning of directory: /home/data/Audio/ 31-mai-2012 17:19:16 - INFO :: Thread-257 : Checking filepaths to see if we can find any matches 31-mai-2012 18:06:31 - INFO :: Thread-307 : Headphones is already up-to-date. 31-mai-2012 19:06:48 - INFO :: Thread-320 : Scanning music directory: /home/data/Audio/ 31-mai-2012 22:26:36 - INFO :: Thread-320 : Completed scanning of directory: /home/data/Audio/ 31-mai-2012 22:26:36 - INFO :: Thread-320 : Checking filepaths to see if we can find any matches

rembo10 commented 12 years ago

The actual log file might provide more clues

Headphonesdir/logs/headphones.log On Jun 1, 2012 2:20 PM, "zoic21" < reply@reply.github.com> wrote:

Hi, Headphones has restarted again, here the last line log : 31-mai-2012 00:06:30 - INFO :: Thread-84 : Headphones is already up-to-date. 31-mai-2012 02:20:36 - INFO :: Thread-71 : Completed scanning of directory: /home/data/Audio/ 31-mai-2012 02:20:36 - INFO :: Thread-71 : Checking filepaths to see if we can find any matches 31-mai-2012 04:06:30 - INFO :: Thread-133 : Scanning music directory: /home/data/Audio/ 31-mai-2012 06:06:31 - INFO :: Thread-158 : Headphones is already up-to-date. 31-mai-2012 07:20:05 - INFO :: Thread-133 : Completed scanning of directory: /home/data/Audio/ 31-mai-2012 07:20:05 - INFO :: Thread-133 : Checking filepaths to see if we can find any matches 31-mai-2012 09:06:48 - INFO :: Thread-195 : Scanning music directory: /home/data/Audio/ 31-mai-2012 12:06:31 - INFO :: Thread-232 : Headphones is already up-to-date. 31-mai-2012 12:20:22 - INFO :: Thread-195 : Completed scanning of directory: /home/data/Audio/ 31-mai-2012 12:20:22 - INFO :: Thread-195 : Checking filepaths to see if we can find any matches 31-mai-2012 14:06:39 - INFO :: Thread-257 : Scanning music directory: /home/data/Audio/ 31-mai-2012 17:19:16 - INFO :: Thread-257 : Completed scanning of directory: /home/data/Audio/ 31-mai-2012 17:19:16 - INFO :: Thread-257 : Checking filepaths to see if we can find any matches 31-mai-2012 18:06:31 - INFO :: Thread-307 : Headphones is already up-to-date. 31-mai-2012 19:06:48 - INFO :: Thread-320 : Scanning music directory: /home/data/Audio/ 31-mai-2012 22:26:36 - INFO :: Thread-320 : Completed scanning of directory: /home/data/Audio/ 31-mai-2012 22:26:36 - INFO :: Thread-320 : Checking filepaths to see if we can find any matches


Reply to this email directly or view it on GitHub: https://github.com/rembo10/headphones/issues/645#issuecomment-6055298

zoic21 commented 12 years ago

This is headphones.log. Here you can see I restart headphones :

root@**:/home/www/vhosts/******/logs# vim headphones.log 31-mai-2012 02:20:36 - INFO :: Thread-71 : Checking filepaths to see if we can find any matches 31-mai-2012 04:06:30 - INFO :: Thread-133 : Scanning music directory: /home/data/Audio/ 31-mai-2012 06:06:31 - INFO :: Thread-158 : Headphones is already up-to-date. 31-mai-2012 07:20:05 - INFO :: Thread-133 : Completed scanning of directory: /home/data/Audio/ 31-mai-2012 07:20:05 - INFO :: Thread-133 : Checking filepaths to see if we can find any matches 31-mai-2012 09:06:48 - INFO :: Thread-195 : Scanning music directory: /home/data/Audio/ 31-mai-2012 12:06:31 - INFO :: Thread-232 : Headphones is already up-to-date. 31-mai-2012 12:20:22 - INFO :: Thread-195 : Completed scanning of directory: /home/data/Audio/ 31-mai-2012 12:20:22 - INFO :: Thread-195 : Checking filepaths to see if we can find any matches 31-mai-2012 14:06:39 - INFO :: Thread-257 : Scanning music directory: /home/data/Audio/ 31-mai-2012 17:19:16 - INFO :: Thread-257 : Completed scanning of directory: /home/data/Audio/ 31-mai-2012 17:19:16 - INFO :: Thread-257 : Checking filepaths to see if we can find any matches 31-mai-2012 18:06:31 - INFO :: Thread-307 : Headphones is already up-to-date. 31-mai-2012 19:06:48 - INFO :: Thread-320 : Scanning music directory: /home/data/Audio/ 31-mai-2012 22:26:36 - INFO :: Thread-320 : Completed scanning of directory: /home/data/Audio/ 31-mai-2012 22:26:36 - INFO :: Thread-320 : Checking filepaths to see if we can find any matches 01-juin-2012 09:53:44 - INFO :: MainThread : Checking to see if the database has all tables.... 01-juin-2012 09:53:44 - DEBUG :: MainThread : Trying to execute: "git rev-parse HEAD" with shell in /home/www/vhosts/***** 01-juin-2012 09:53:44 - DEBUG :: MainThread : Git output: f9f129b3e09a1b33ab30577863bafff222e3d8c0

01-juin-2012 09:53:45 - INFO :: MainThread : Headphones is already up-to-date. 01-juin-2012 09:53:45 - INFO :: MainThread : Starting Headphones on port: 8181

zoic21 commented 12 years ago

The problem with the CPU is back

Top : PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
25360 headphon 20 0 2204m 1.0g 2184 S 84 53.4 1771:52 python

The last log entries : 06-juin-2012 11:16:58 - INFO :: Thread-604 : Updating complete for: Fall Out Boy 06-juin-2012 11:16:59 - DEBUG :: Thread-604 : Using the following server values: MBHost: 178.63.142.150 ; MBPort: 8181 ; Sleep Interval: 0 06-juin-2012 11:17:04 - INFO :: Thread-604 : Now adding/updating: Fastball 06-juin-2012 11:17:05 - DEBUG :: Thread-604 : Using the following server values: MBHost: 178.63.142.150 ; MBPort: 8181 ; Sleep Interval: 0 06-juin-2012 11:17:09 - INFO :: Thread-604 : Now adding/updating album: All the Pain Money Can Buy 06-juin-2012 11:19:58 - DEBUG :: Thread-604 : Using the following server values: MBHost: 178.63.142.150 ; MBPort: 8181 ; Sleep Interval: 0 06-juin-2012 11:19:59 - INFO :: Thread-604 : Now adding/updating album: Live from Jupiter Records 06-juin-2012 11:20:20 - DEBUG :: Thread-604 : Using the following server values: MBHost: 178.63.142.150 ; MBPort: 8181 ; Sleep Interval: 0 06-juin-2012 11:20:43 - INFO :: Thread-604 : Now adding/updating album: Keep Your Wig On

The probleme is here when headphones rescan library. Maybe I make a mistake somewhere in install?

fullbright commented 12 years ago

Hello,

I also have the same issue. When Headphones auto updates (wanted albums or library), it raise the CPU load to 98% and stays at that level, making everything run very slowly.

I must go to the web interface and click on he restart link, and CPU load get back to ~20% again.

rembo10 commented 12 years ago

It's gotta be getting stuck somewhere, but not producing any error messages. Maybe can you tr running it from the terminal to see if there are any exceptions during the library scan?

On Jun 19, 2012, at 11:02 AM, fullbrightreply@reply.github.com wrote:

Hello,

I also have the same issue. When Headphones auto updates (wanted albums or library), it raise the CPU load to 98% and stays at that level, making everything run very slowly.

I must go to the web interface and click on he restart link, and CPU load get back to ~20% again.


Reply to this email directly or view it on GitHub: https://github.com/rembo10/headphones/issues/645#issuecomment-6416388

zoic21 commented 12 years ago

I make your test and I force refresh of music but the CPU and memory is ok so it's not when headphones refresh music...

fullbright commented 12 years ago

Hello,

Thanks for the tests. I'll do further tests and see where this is from.

Le 22 juin 2012 23:27, "zoic21" < reply@reply.github.com> a écrit :

I make your test and I force refresh of music but the CPU and memory is ok so it's not when headphones refresh music...


Reply to this email directly or view it on GitHub: https://github.com/rembo10/headphones/issues/645#issuecomment-6518738

cptjhmiller commented 12 years ago

I am getting this also, 80-85% Yesterday i heard cpu fan go into overdrive, looked at running proccess and headphones was as 165% restarted it and it was good again for a bit but still does go up to 80-85%

I have 4 GB memory and 2 x 3ghz running on Openmediavault(Debian) and music collection is around 66GB

I ran headphones in a terminal and top in another, Updated artists 1-2% (9% max) Scan music directory, bang 83% There was no output in the terminal apart from what has been posted above to help track down what is causing this to happen.

I love headphones but this is making me think of uninstalling as its causing whole system to slow down.

zoic21 commented 12 years ago

I also still the problem pending a resolution of the problem I stopped headphones ...

cptjhmiller commented 12 years ago

I want to help resolve this so will keep using it for now but without any error report i think it will be hard for anyone to track down what is causing this to happen.

What system are you using to run headphones? Other users with this problem should post what system they are using as it may be a system issue and will also help eliminate probable causes.

rembo10 commented 12 years ago

Are you guys running it from source? I'd like to narrow this down and fix it asap On Jul 18, 2012 2:27 PM, "cptjhmiller" < reply@reply.github.com> wrote:

I want to help resolve this so will keep using it for now but without any error report i think it will be hard for anyone to track down what is causing this to happen.


Reply to this email directly or view it on GitHub: https://github.com/rembo10/headphones/issues/645#issuecomment-7060507

cptjhmiller commented 12 years ago

I am, git clone then i remove the .git folder to allow updates.

Thanks for having a go at getting this sorted.

cptjhmiller commented 12 years ago

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 2788 root 20 0 383m 113m 4508 S 192 2.9 122:10.55 python

192% thats too high to leave running, will have to disable it for now but will be happy to test any changes you suggest.

rembo10 commented 12 years ago

No that's crazy high. Let me work on something - thanks for the heads up

On Jul 18, 2012, at 4:51 PM, cptjhmillerreply@reply.github.com wrote:

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 2788 root 20 0 383m 113m 4508 S 192 2.9 122:10.55 python

192% thats too high to leave running, will have to disable it for now but will be happy to test any changes you suggest.


Reply to this email directly or view it on GitHub: https://github.com/rembo10/headphones/issues/645#issuecomment-7064505

Alfiegerner commented 11 years ago

Same problem, here very high cpu (90% ish) on scanning library. Let me know if you want me to try adding debug etc to test.

rembo10 commented 11 years ago

I took out the "checking empty filepaths" code, since i thought that might be the culprit but its not..... Maybe i can put together a little author script you guys can run that will basically mimic the library scan but with more logging?

rembo10 commented 11 years ago

*python

Alfiegerner commented 11 years ago

Yep, no problem, happy to run that, or if you'd like me to apply a patch to my install, whatever's easiest for you.

cptjhmiller commented 11 years ago

Same here, would be happy to help out in what ever way is needed to track down this error/bug

rembo10 commented 11 years ago

Cool, lemme write something up. A script is easier since you won't have to keep restarting headphones with changes

On Jul 29, 2012, at 7:18 PM, cptjhmillerreply@reply.github.com wrote:

Same here, would be happy to help out in what ever way is needed to track down this error/bug


Reply to this email directly or view it on GitHub: https://github.com/rembo10/headphones/issues/645#issuecomment-7353105

rembo10 commented 11 years ago

Sorry guys, posted the debug info in the wrong thread. I wrote up a script that tries to mimic the library scan. It's in the debug branch. To get it, cd into your headphones directory, and run: git fetch origin git checkout debug python debug.py

Depending on the results of that, I'll either tweak the debug script or have a fix ready

cptjhmiller commented 11 years ago

I am in Turkey atm but will try it when i return home on Friday. I would try it but dont wont to risk crashing my server.

rembo10 commented 11 years ago

A possible fix is in the develop branch

Alfiegerner commented 11 years ago

No joy I'm afraid.

First I tried the devlop branch. I replicated as before: went to Manage screen, and pressed save on the existing library path, top shows one core maxed out almost immediately.

Next tried debug.py, and it behaves itself pretty well, cpu not going above 20 usage total.

Sorry to be bearer of bad tidings :(

rembo10 commented 11 years ago

Dumb question but did you restart after switching branches? On Aug 2, 2012 2:03 PM, "Alfiegerner" < reply@reply.github.com> wrote:

No joy I'm afraid.

First I tried the devlop branch. I replicated as before: went to Manage screen, and pressed save on the existing library path, top shows one core maxed out almost immediately.

Next tried debug.py, and it behaves itself pretty well, cpu not going above 20 usage total.

Sorry to be bearer of bad tidings :(


Reply to this email directly or view it on GitHub: https://github.com/rembo10/headphones/issues/645#issuecomment-7449834

Alfiegerner commented 11 years ago

Yep, fraid so, definitely restarted with the dev branch.

Might have something here, just got this from the debug.py:

Traceback (most recent call last): File "debug.py", line 54, in print "Reading file: " + song.decode(SYS_ENCODING) UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in position 65: ordinal not in range(128)

I was running it over ssh and didn't give enough time for it to run through before, just tweaked it to output to /tmp/test.log and see the script fail with this.

rembo10 commented 11 years ago

Ah ok, yeah that's what I was expecting to see. But the working theory was that the library scan thread would fail on that error, and then another would start up a couple hours later and fail, then another.....

But if its jumping to 80% straight away, its something else as well. On Aug 2, 2012 3:22 PM, "Alfiegerner" < reply@reply.github.com> wrote:

Yep, fraid so, definitely restarted with the dev branch.

Might have something here, just got this from the debug.py:

Traceback (most recent call last): File "debug.py", line 54, in print "Reading file: " + song.decode(SYS_ENCODING) UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in position 65: ordinal not in range(128)

I was running it over ssh and didn't give enough time for it to run through before, just tweaked it to output to /tmp/test.log and see the script fail with this.


Reply to this email directly or view it on GitHub: https://github.com/rembo10/headphones/issues/645#issuecomment-7451206

Alfiegerner commented 11 years ago

Just doing some hacking about and it looks to be the database operations (on my system at least). Comment out the db IO and library scan is fine, with db 1 cpu core is shot. Will have more of a play tomorrow.

Sent from my phone

On 2/08/2012, at 10:11 PM, rembo10 reply@reply.github.com wrote:

Ah ok, yeah that's what I was expecting to see. But the working theory was that the library scan thread would fail on that error, and then another would start up a couple hours later and fail, then another.....

But if its jumping to 80% straight away, its something else as well. On Aug 2, 2012 3:22 PM, "Alfiegerner" < reply@reply.github.com> wrote:

Yep, fraid so, definitely restarted with the dev branch.

Might have something here, just got this from the debug.py:

Traceback (most recent call last): File "debug.py", line 54, in print "Reading file: " + song.decode(SYS_ENCODING) UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in position 65: ordinal not in range(128)

I was running it over ssh and didn't give enough time for it to run through before, just tweaked it to output to /tmp/test.log and see the script fail with this.


Reply to this email directly or view it on GitHub: https://github.com/rembo10/headphones/issues/645#issuecomment-7451206


Reply to this email directly or view it on GitHub: https://github.com/rembo10/headphones/issues/645#issuecomment-7451590

rembo10 commented 11 years ago

That's it. And that's not duplicated in the debug file. Good work, will get a fix up shortly On Aug 2, 2012 4:02 PM, "Alfiegerner" < reply@reply.github.com> wrote:

Just doing some hacking about and it looks to be the database operations (on my system at least). Comment out the db IO and library scan is fine, with db 1 cpu core is shot. Will have more of a play tomorrow.

Sent from my phone

On 2/08/2012, at 10:11 PM, rembo10 reply@reply.github.com wrote:

Ah ok, yeah that's what I was expecting to see. But the working theory was that the library scan thread would fail on that error, and then another would start up a couple hours later and fail, then another.....

But if its jumping to 80% straight away, its something else as well. On Aug 2, 2012 3:22 PM, "Alfiegerner" < reply@reply.github.com> wrote:

Yep, fraid so, definitely restarted with the dev branch.

Might have something here, just got this from the debug.py:

Traceback (most recent call last): File "debug.py", line 54, in print "Reading file: " + song.decode(SYS_ENCODING) UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in position 65: ordinal not in range(128)

I was running it over ssh and didn't give enough time for it to run through before, just tweaked it to output to /tmp/test.log and see the script fail with this.


Reply to this email directly or view it on GitHub: https://github.com/rembo10/headphones/issues/645#issuecomment-7451206


Reply to this email directly or view it on GitHub: https://github.com/rembo10/headphones/issues/645#issuecomment-7451590


Reply to this email directly or view it on GitHub: https://github.com/rembo10/headphones/issues/645#issuecomment-7451986

rembo10 commented 11 years ago

Can't seem to find a good fix for this. Just want to figure out if there might be any underlying cause. Can you guys post your:

  1. Operating System
  2. Version of Python (python -V)
  3. Version of sqlite3 (sqlite3 --version)

I think that should be it for now, but if you think of anything else relevant, post it here!

zoic21 commented 11 years ago

Here my informations : 1 : Ubuntu 12.04 (kernel : 3.2.2 x64) 2 : Python 2.7.3 3 : 3.7.9 2011-11-01 00:52:41 c7c6050ef060877ebe77b41d959e9df13f8c9b5e

I hope this can help.

Alfiegerner commented 11 years ago

And mine:

  1. Ubuntu 12.04 3.2.0-27-generic #43-Ubuntu
  2. Python 2.7.3
  3. 3.7.9 2011-11-01 00:52:41
cptjhmiller commented 11 years ago

Here's mine

  1. Debian (OpenMediaVault) 2.6.32-5-amd64
  2. Python 2.6.6
  3. 3.7.3
rembo10 commented 11 years ago

Ah OK, so its not your version of python. Does the CPU usage jump even before you see the "Scanning music directory: /path/to/music" in the log?

rembo10 commented 11 years ago

Well I'm not sure if it improved the CPU usage for you guys but the library scan is now about 10x faster . Each transaction was also calling a database commit (which was like 3 db commits per song). Now it does 1 commit every 100 songs. It might help.... I'll push it up to the develop branch now On Aug 7, 2012 2:16 PM, "cptjhmiller" notifications@github.com wrote:

Here's mine

  1. Debian (OpenMediaVault) 2.6.32-5-amd64
  2. Python 2.6.6
  3. 3.7.3

— Reply to this email directly or view it on GitHubhttps://github.com/rembo10/headphones/issues/645#issuecomment-7547194.

cptjhmiller commented 11 years ago

It does jump around a bit when i first start Headphones service but does not go to high and soon settles down to 0-6, some times 10 but not that often.

Within about 2 seconds of clicking save changes i see cpu usage rise to 80+ and stays like that, or higher until i quit Headphones.

I also tried with a compiled version of python2.7 but still acts the same as 2.6.

I will now try the new develop version to see if that changes the cpu scanning issues.

Thanks Rembo

rembo10 commented 11 years ago

Do you guys have your music on a SSD? Maybe that's the reason my CPU usage is low - because there's a disk bottleneck..... taking out the frequent comments speeds it up, but makes my CPU usage jump from like 25% to 50% while its scanning

cptjhmiller commented 11 years ago

I don't use SSD. All my media is split across 7 sata drives that appear as 1 big drive (greyhole) other Python apps such as Couchpotato and SickBeard can scan my media with no issues.

rembo10 commented 11 years ago

So even after the scan is done, the CPU usage stays that high? I'm interested in this situation: headphones scans the library, either finds no new artists, or finds new artists and finishes adding them. At that point, it should be idle, using 1-2% max just running background stuff. On Aug 7, 2012 3:48 PM, "cptjhmiller" notifications@github.com wrote:

It does jump around a bit when i first start Headphones service but does not go to high and soon settles down to 0-6, some times 10 but not that often.

Within about 2 seconds of clicking save changes i see cpu usage rise to 80+ and stays like that, or higher until i quit Headphones.

I also tried with a compiled version of python2.7 but still acts the same as 2.6.

I will now try the new develop version to see if that changes the cpu scanning issues.

Thanks Rembo

— Reply to this email directly or view it on GitHubhttps://github.com/rembo10/headphones/issues/645#issuecomment-7548967.

cptjhmiller commented 11 years ago

No change re cpu usage.

I think it does go back to normal after it finishes the scan but can't be 100% sure as i have been stopping Headphones before it finishes. I will let the latest dev version scan till the end to see it it does return to normal.

Off topic, i do have issues with develop branch where it says im 0 commits behind even tho my version number matches latest version on git hub. I installed both master and develop versions the same way and added path to git in the config. Will make a new topic about this later on if you want.

cptjhmiller commented 11 years ago

I thought it had finished the scan and cpu went back to normal but checking the logs i see

2012-08-07 11:44:27 WARNING Database Error: database is locked.

Will restart system and try again.

cptjhmiller commented 11 years ago

I will go back on my other comment about cpu usage. After restarting the system i started top then headphones and it does raise cpu to a very high value (130+) but does not last long so explains why i missed it before.

Its running the scan again now just to see if same error happens or if is goes back to normal after a completed scan.

rembo10 commented 11 years ago

The develop branch still checks against the master branch to see if it's up to date. I tried setting it to check against the develop branch but anytime I merge it into master, it overwrites the branch name. Until I get it working right, it'll probably stay that way :-)

I'll look into the database lock error, but usually it'll retry retry until it goes through. So if you only saw one of those its not a huge deal.

Are you keeping your music on an ssd? That's the only thing I can think that would make it CPU bound instead of disk bound (which I think is the case in my setup) On Aug 7, 2012 4:26 PM, "cptjhmiller" notifications@github.com wrote:

I will go back on my other comment about cpu usage. After restarting the system i started top then headphones and it does raise cpu to a very high value (130+) but does not last long so explains why i missed it before.

Its running the scan again now just to see if same error happens or if is goes back to normal after a completed scan.

— Reply to this email directly or view it on GitHubhttps://github.com/rembo10/headphones/issues/645#issuecomment-7549770.

cptjhmiller commented 11 years ago

Thanks for the info on the develop branch, ill just ignor it then :)

Last time i saw 5ish, current scan started 24 mins ago has 20+ warnings about the locked database.

I don't have any ssd's in my system. I have a few drives with symbolic links into 1 main hdd (see greyhole)

rembo10 commented 11 years ago

OK, gotcha. I'll get those database lock errors fixed. But if you're seeing the same CPU usage then I'll keep working on it - but I'll probably keep the changes in since it speeds things up quite a bit On Aug 7, 2012 5:16 PM, "cptjhmiller" notifications@github.com wrote:

Thanks for the info on the develop branch, ill just ignor it then :)

Last time i saw 5ish, current scan started 24 mins ago has 20+ warnings about the locked database.

I don't have any ssd's in my system. I have a few drives with symbolic links into 1 main hdd (see greyhole)

— Reply to this email directly or view it on GitHubhttps://github.com/rembo10/headphones/issues/645#issuecomment-7550675.

cptjhmiller commented 11 years ago

Just to report that cpu usage did return to normal after the scan completed.

2012-08-07 11:52:15 INFO Scanning music directory: /pool/NAS/Audio/My Music 2012-08-07 14:17:39 INFO Completed scanning directory: /pool/NAS/Audio/My Music

2hrs 25 mins for 40,321 files. Thats around 5 seconds per file.