New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create a sleep mechanism for slowing down mining process #3475
base: master
Are you sure you want to change the base?
Conversation
Add library
Add attribute sleepNanoSeconds
Parse value from the environment variable named as XMRIG_SLEEP_NANOSECONDS
Add the effective line which enables slowing down the mining process by sleeping for given nanoseconds
This is a weird place to put |
Now I have made some progress here. I make the dataset preparation process single threaded in ASM mode (because I cannot figure out how to sleep in assembly code in PIE compilation mode), throttled in non-ASM mode but taking ages to prepare so therefore out of major concern, and finally throttled hash functions. |
Honestly, this PR is a bunch of hacks on top of each other, and there is 0% probability it will be merged. It's fine for your own purposes, I guess. |
https://xmrig.com/docs/miner/command-line-options |
That being said, I think it is possible to create some better mechanism for controlling thread occupation, by first measuring the average time to perform a single loop in hash function, then sleep accordingly to the measured time, so that the user will only have to provide a value ranging from 1 to 99 in percentage, simplifying the guesswork. |
This pull request provides a configurable environmental variable called
XMRIG_SLEEP_NANOSECONDS
which value is default to zero.One can configure it to slow down the mining process, effectively eliminate the issue of utilizing a single thread 100% at all the time, thereby increase the overall system stability and lower the thermo pressure.
Fix #1322