Launching Bitcoin Core with Reduced CPU Priority

14 replies 372 views
Posts: 6 · Reputation: 103
#1Oct 3, 2022, 10:38 AM
I've got Bitcoin Core version v22.0.0 running on Windows 7, and it kicks off automatically when the computer starts using the command "C:\Program Files\Bitcoin\bitcoin-qt.exe" -min -chain=main. The thing is, it really hogs all the CPU, making my PC super slow to respond at first. Is there a way to launch it with some options that cut down the priority level?
2 Reply Quote Share
hash_bossLegendary
Posts: 1166 · Reputation: 5261
#2Oct 3, 2022, 03:32 PM
You're probably know about it, but both Bitcoin Core 22.0 and Windows 7 are outdated. I would recommend you to both of them. Looking at https://github.com/bitcoin/bitcoin/blob/v22.0/src/init.cpp, looks like only -par=1 only can be used to limit total core/thread used by Bitcoin Core 22.0. Besides that, try setting bitcoin-qt.exe to have lower CPU priority using this guide https://answers.microsoft.com/en-us/windows/forum/all/how-to-permanently-set-priority-processes-using/df82bd40-ce52-4b84-af34-4d93da17d079.
4 Reply Quote Share
Posts: 43 · Reputation: 203
#3Oct 3, 2022, 09:50 PM
it either can put its instructions to cpu pipeline or it can't. You can't low-profile it from outside. with this ms stuff all you'll gain is frozen gui because its messages will not be processed.
3 Reply Quote Share
gr3g.0rbitHero Member
Posts: 1025 · Reputation: 2646
#4Oct 3, 2022, 11:53 PM
So it's the PC that is freezing, not just Bitcoin Core's GUI? Not to lower Bitcoin Core's priority but -par can minimize the CPU usage dedicated for script verifications, try to set a low number of CPU threads. Its default sets Core to use all minus one of your CPU Cores. Other CPU resource intensive task aren't affected by that command line arg though. -edit- default is -par=0 (auto) but it's what I've described which is CPU cores -1.
4 Reply Quote Share
L0neDegenSenior Member
Posts: 331 · Reputation: 1464
#5Oct 4, 2022, 02:06 AM
I don't have direct experience with this issue with Bitcoin Core, but: * In my experience with various other CPU intensive software I use (more than average) max - 1 usually leaves Windows quite responsive. * Also keep an eye on the disk usage, since in my experience, if CPU is already at max - 1 then the throttling happens because of the disk (PS. is the blockchain on SSD or HDD?)
6 Reply Quote Share
colddiamondHero Member
Posts: 623 · Reputation: 2467
#6Oct 5, 2022, 01:35 AM
You can also use the wmic command to set the priority of Core https://superuser.com/questions/620724/changing-windows-process-priority-via-command-line If you do it in the registry you have to remember set it back up if you want it faster. Doing it with a command lets you just have a couple of different batch scripts sitting on your desktop to change it's resource use. -Dave
0 Reply Quote Share
LuckyCoinLegendary
Posts: 832 · Reputation: 4795
#7Oct 6, 2022, 02:31 AM
Lowering the CPU priority isn't going to help you if one of the processes is disk-intensive, because disk reads and writes are uninterruptible by nature, which means the kernel cannot just make the other, high-priority process run in its place because disk access requires a CPU core as well. Also, eventually, other programs will need to read data from the disk and if you have too many of those programs running, you run out of cores. And your system becomes unresponsive, your mouse freezes etc. OP, how many cores does your system have? Although it's better to just upgrade your disk setup.
4 Reply Quote Share
Posts: 6 · Reputation: 103
#8Oct 6, 2022, 03:38 AM
Thanks for the advice. I'll go down the route of a batch file and setting the priority to /low of /below normal The PC is pretty powerful with 8 cores, 40Gb RAM and SSD throughout. The blockchain is on its own disk. So, I have the Windows startup command D:\temp\BTC.bat which says: @echo off set start "Bitcoin Core" /LOW "C:\Program Files\Bitcoin\bitcoin-qt.exe" -min -chain=main It seems to be OK so far
2 Reply Quote Share
Posts: 43 · Reputation: 203
#9Oct 6, 2022, 08:20 AM
/LOW does nothing. use -1 or so and you'll see a huge difference (from bad to worse) there's dma thing on stage and it may be not so. Say you can burn cd on single core with no freezing of other stuff
4 Reply Quote Share
jake.seedFull Member
Posts: 180 · Reputation: 698
#10Oct 6, 2022, 08:40 PM
If your system is already equipped with powerful hardware, instead of limiting CPU usage with -par, optimizing disk I/O performance might yield better results. For instance, ensuring the blockchain is stored on a high-speed SSD or using disk prioritization tools can significantly improve responsiveness
4 Reply Quote Share
gr3g.0rbitHero Member
Posts: 1025 · Reputation: 2646
#11Oct 7, 2022, 09:35 PM
That's set by default, yet, he mentioned that the PC isn't responding while Bitcoin Core is using all of his Cores. That depends on the specs and the PC's usage, -par is only for script verifications and if all set cores are fully utilized, the remaining core will be used by Bitcoin Core's other processes. You mean -par=-1? The suggestion to use a lower value is to keep a few CPU Cores free to solve his 100% CPU usage by Bitcoin Core. It will reduce Bitcoin Core's sync performance, yes; but that's a solution if his whole PC is not responding due to the mentioned 100% CPU usage. This should've been written beforehand. Whole datadir and not just the blockchain? If so, you can rule-out 100% system disk usage scenario, the OS shouldn't be affected in this case. 8-cores but still 100% used by Bitcoin Core, low-power low-frequency CPU perhaps? Or it's actually Bitcoin Core that's not responding, not the PC? Because this is normal in Windows.
0 Reply Quote Share
Posts: 43 · Reputation: 203
#12Oct 8, 2022, 03:05 AM
set process priority to exact value. winapi
4 Reply Quote Share
humbleledgerLegendary
Posts: 1027 · Reputation: 6554
#13Oct 8, 2022, 05:26 AM
I haven't used Windows ever for Bitcoin Core, but with those specs a computer shouldn't freeze from verifying a few blocks. I can only imagine disk-IO being a limitation, but with that much RAM that shouldn't be a problem. If your OS can't properly multitask, changing priority isn't going to help.
5 Reply Quote Share
Posts: 8 · Reputation: 163
#14Oct 8, 2022, 02:00 PM
I did this in Windows and it initially stuck out everything on the side and causing chaos online. Of it gradually improve with time.
4 Reply Quote Share
L0neDegenSenior Member
Posts: 331 · Reputation: 1464
#15Oct 8, 2022, 05:00 PM
I completely agree. As the others said, such a setup should handle easily Bitcoin Core. OP another ideas: 1. Double check that the data dir is indeed on the separate SSD and not %AppData%\Bitcoin 2. Consider adding the data dir to your antivirus exclusion
5 Reply Quote Share

Related topics