Skip to content
Snippets Groups Projects

[enh] Ecomode improvements

Merged Cédric Moreau requested to merge reduce_cpu_improvements into reduce_cpu
4 files
+ 34
28
Compare changes
  • Side-by-side
  • Inline
Files
4
@@ -201,12 +201,12 @@ export class BlockProver {
this.logger.info('Done: #%s, %s in %ss instead of %ss (%s tests, ~%s tests/s)', block.number, proof.hash, (duration / 1000).toFixed(2),
this.conf.avgGenTime, testsCount, testsPerSecond.toFixed(2));
this.logger.info('FOUND proof-of-work with %s leading zeros followed by [0-' + highMark + ']!', nbZeros);
if(this.conf.ecoMode === true && this.conf.nbCores*testsPerSecond > 300) {
if(this.conf.ecoMode === true && this.conf.nbCores*testsPerSecond > ProverConstants.ECO_MODE_MINIMAL_TESTS_PER_SECONDS) {
if(this.conf.nbCores > 1) {
this.logger.info("Reducing number of CPU cores "+this.conf.nbCores)
this.conf.nbCores = this.conf.nbCores -1
}
else if(this.conf.cpu > 0.19){
else if(this.conf.cpu > ProverConstants.ECO_MODE_MINIMAL_CPU){
let cpu:number = this.conf.cpu - 0.1
this.logger.info("Slowing down the CPU to "+cpu)
this.changeCPU(cpu)
Loading