[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: ThinkPad fan



> > I should probably clean the fans, but another thing I usually do for
> > normal
> > usage is to limit the cpu speed.
> >
> > As root:
> >
> > #echo 60 > /sys/devices/system/cpu/intel_pstate/max_perf_pct
> >
> > Or whatever number you feel good with. Unless I am doing heavy usage,
> > I do not
> > notice performance penalties and temperatures do not get that high.
>
> This sounds like a good suggestion.

Indeed, this sounds like a great solution for me. Limiting CPUs to 80% does not increase terribly the execution time, and with thinkfan active it stays below 70C when running the same code that I was testing before (without thinkfan it reaches 80C). I attach below the scripts that I am using to set the cpu limit at boot time by enabling "systemctl enable set_cpu_max_perf_pct".

Thanks,
Francesco




== /usr/bin/set_cpu_max_perf_pct ==
#!/bin/sh

# Set the max CPU use percentage
start() {
    echo 80 > /sys/devices/system/cpu/intel_pstate/max_perf_pct
}

# Revert back to 100 percent
stop() {
    echo 100 > /sys/devices/system/cpu/intel_pstate/max_perf_pct
}

case $1 in
    start|stop) "$1" ;;
esac




== /etc/systemd/system/set_cpu_max_perf_pct.service ==
[Unit]
Description=Limit global cpu usage

[Service]
Type=oneshot
ExecStart=/usr/bin/set_cpu_max_perf_pct start
ExecStop=/usr/bin/set_cpu_max_perf_pct stop
RemainAfterExit=yes


[Install]
WantedBy=multi-user.target

Reply to: