Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: LobsterMan on September 09, 2010, 01:10:41 AM



Title: Way to throttle CPU usage on windows?
Post by: LobsterMan on September 09, 2010, 01:10:41 AM
I just setup bitcoin on my windows box, and I noticed that there is no way to prevent bitcoin.exe from sucking up all of my CPU cycles. Setting bitcoin.exe to low priority in the taskmanager is kind of a crappy workaround, but it still uses up all of my CPU time (and I fear what it may do to my power bill).

Is there any way to restrict the amount of CPU time or resource percentage that I devote to bitcoin generation? I'm running an old single-core athlon64 on my server, so restricting the number of cores doesn't really do me much good either.

EDIT: Just realized this may be in the wrong forum....sorry if it is.....


Title: Re: Way to throttle CPU usage on windows?
Post by: LZ on September 11, 2010, 07:06:37 AM
Read this (https://web.archive.org/web/2010/http://technet.microsoft.com/en-us/library/cc940378.aspx) (or that (https://web.archive.org/web/2010/http://msdn.microsoft.com/en-us/library/ms685100(VS.85).aspx)). I hope you'll understand how it works. :)


Title: Re: Way to throttle CPU usage on windows?
Post by: LobsterMan on September 13, 2010, 09:10:05 AM
That document really just explains how the thread scheduling works, but didn't really mention at all how to access or modify these things. It also referenced figures that were not present on the page....perhaps the page is incomplete? Or am I just missing something?


Title: Re: Way to throttle CPU usage on windows?
Post by: LZ on September 13, 2010, 10:37:04 AM
I just wanted to say that process/thread with lower priority
will always give CPU cycles to process/thread with higher if
that higher process/thread will really need that CPU time...

If you want to reduce the power bill you should stop Bitcoin
generation. Each generated bitcoin is confirmation of costs.
You can change the source code that it uses less CPU time,
but I don't think that you can generate with a low khash/s.

Bitcoin uses Normal process priority (15..1) and Lowest thread
priority (22..2) for bitcoin generation thread. It is priority level
6 so bitcoin generation thread will always gives CPU cycles to
other processes/threads if they need it because they usually
have priority level higher than 6. Most have priority level ~8.

If you'll change Bitcoin's process priority to Idle (15..1) with
Task Manager (https://web.archive.org/web/2010/http://en.wikipedia.org/wiki/Task_Manager_(Windows)) or Process Explorer (https://web.archive.org/web/2010/http://en.wikipedia.org/wiki/Process_Explorer) then bitcoin generation
thread will have priority 2 and will give CPU cycles to every
process/thread with priority higher than 2 (read: to every).

Usually this is not necessary. Default setting is the best.


Title: Re: Way to throttle CPU usage on windows?
Post by: true on September 14, 2010, 03:53:51 AM
The default setting causes some older computers I use to be extremely unresponsive. I see no reason why Bitcoin should _not_ yield to nearly any other task, nor why this is not yet at least an option in the client.


Title: Re: Way to throttle CPU usage on windows?
Post by: nethoncho on September 14, 2010, 03:58:06 AM
I use Prio to set (and remember) the priority of bitcon
http://www.prnwatch.com/prio.html (http://www.prnwatch.com/prio.html)
And it is free (as in beer, not speech)