Bitcoin Forum

Bitcoin => Bitcoin Technical Support => Topic started by: Flow on February 12, 2011, 10:36:57 PM



Title: Limit bitcoin to only use 2 CPUs under linux
Post by: Flow on February 12, 2011, 10:36:57 PM
I see this option in the GUI, but could not found the corresponding line in the command options nor the bitcoin.conf. I would like to run bitcoin on my server, which has no GUI available.

Flow


Title: Re: Limit bitcoin to only use 2 CPUs under linux
Post by: grondilu on February 12, 2011, 10:39:26 PM
I see this option in the GUI, but could not found the corresponding line in the command options nor the bitcoin.conf. I would like to run bitcoin on my server, which has no GUI available.

Flow

I think you can do that on a OS level.  For instance, running "htop" you can press 'a' to set CPU affinity.


Title: Re: Limit bitcoin to only use 2 CPUs under linux
Post by: Flow on February 12, 2011, 11:03:52 PM
Thanks. But I prefer a persistent option, because the binary will still spawn 4 miner threads, when I want only 2.
Just wondering that there is a option in the GUI, which is not represented anywhere else. :-(


Title: Re: Limit bitcoin to only use 2 CPUs under linux
Post by: mail2345 on February 12, 2011, 11:38:03 PM
I suggest writing a shell script that starts bitcoind and sets affinity.
EDIT:
Or use an external miner, jgarzik's CPU miner has a thread setting.


Title: Re: Limit bitcoin to only use 2 CPUs under linux
Post by: theymos on February 13, 2011, 12:09:44 AM
You can use the RPC command "setgenerate true threadNumber". Bitcoin will store the number of threads to run in your wallet and remember it across runs.


Title: Re: Limit bitcoin to only use 2 CPUs under linux
Post by: Flow on February 13, 2011, 10:33:45 AM
You can use the RPC command "setgenerate true threadNumber". Bitcoin will store the number of threads to run in your wallet and remember it across runs.
How do I issue the RPC from command line?

Edit: Found it. Just set the user name and password in bitcoind.conf and run bitcoind with the given RPC command. Thanks all!


Title: Re: Limit bitcoin to only use 2 CPUs under linux
Post by: theymos on February 13, 2011, 10:42:35 AM
How do I issue the RPC from command line?

Just "bitcoind setgenerate true threadNumber". Bitcoin acts as its own RPC client when it's given any parameters that don't start with a dash.