cpufrequtils (cpufreqd) may help, as well as "AND", Auto-Nice Daemon.
But if there's this noticeable difference between arch and ubuntu, my first line of investigation would be about the differences between them, the odds are that ubuntu is doing stuff it doesn't absolutely need to do. Or doing them badly, in case of different versions of the same things, or alternative tools to do the same thing.
I have this crude bash script I use to avoid overheating in batch processes, perhaps you could adapt something of it for your situation (please don't laugh):
Code:
temp=$(sensors | grep "Core 0" | sed 's|°.*||;s|.*+||;s|\..*||')
case $temp in
3[0-5]) cool="0.2" ;;
3[6-9]) cool="0.4" ;;
4[0-2]) cool=0.15 ;;
4[3-5]) cool=0.35 ;;
4[6-7]) cool=0.65 ;;
4[8-9]) cool=1.2 ;;
5[0-2]) cool=1.8 ;;
5[3-5]) cool=2.3 ;;
5[6-7]) cool=2.8 ;;
5[8-9]) cool=3.5 ;;
6[0-4]) cool=7 ;;
6[5-9]|7[0-9])
echo -e "cooling...$temp\c"
until [ $temp -lt 53 ] ; do
echo -e "...$temp\c"
sleep 0.7
temp=$(sensors | grep "Core 0" | sed 's|°.*||;s|.*+||;s|\..*||')
done
cool=3
;;
8[0-9]) cool=35 ;;
9[0-9]) cool=120 ;;
1[0-9][0-9] ) cool=200
;;
esac
sleep $cool
The logic is probably far from flawless, specially regarding how it would deal with extremely high temperatures, which luckily aren't something usual, anyway. But for common high-cpu batches it eases it a bit for the CPU and I hear less from the fan. I think it's a less sophisticated version of what "cpulimit" does, spacing out processes rather than pausing and resuming processes.
I use it within CLI loops such as "
for file in *.mp3 do something heavy && cool.sh ; done", or before/after scripts that I'll probably sometimes run lots of instances somehow.
But it could perhaps be combined with things like cpulimit in a daemonized script that keeps monitoring this stuff. Along the lines of this script (not mine):
http://searchenterpriselinux.techtar...sses-with-Bash
A note about that script, though:
Code:
info=(`ps -eo pcpu,pid -o comm= | sort -k1 -n -r | head -1`)
USAGE=${info[0]%%.*}
PID=${info[1]}
PNAME=${info[2]}
This is more efficient than the way that script does to get the same variables.