set turbo boost off in performance if load/cpu usage is low

This commit is contained in:
Adnan Hodzic 2020-01-08 19:40:11 +01:00
parent 61f1115d63
commit ff2f87ce6b
1 changed files with 15 additions and 3 deletions

View File

@ -208,9 +208,21 @@ def set_performance():
print("\nTotal CPU usage:", cpuload, "%")
print("Total system load:", load1m, "\n")
print("Setting turbo boost: on")
s.run("echo 0 > /sys/devices/system/cpu/intel_pstate/no_turbo", shell=True)
footer(79)
# conditions for setting turbo in performance
if load1m > 1:
print("High load, setting turbo boost: on")
s.run("echo 0 > /sys/devices/system/cpu/intel_pstate/no_turbo", shell=True)
footer(79)
elif cpuload > 20:
print("High CPU load, setting turbo boost: on")
s.run("echo 0 > /sys/devices/system/cpu/intel_pstate/no_turbo", shell=True)
#print("\n" + "-" * 60 + "\n")
footer(79)
else:
print("Load optimal, setting turbo boost: off")
s.run("echo 1 > /sys/devices/system/cpu/intel_pstate/no_turbo", shell=True)
#print("\n" + "-" * 60 + "\n")
footer(79)
# make turbo suggestions in performance
def mon_performance():