As you see the header of my blog the motto is “Linux TCP/IP, GreenIT and more…” this one will be about Linux and make it more greener
I will present you some ways to make your BeagleBone more efficient but still powerful.
Official and out of production BeagleBone runs the Ångström Linux distribution with following power consumption (in milliamperes at 5Volt):
Beginning with Linux Kernel version 2.6.0 you are able to scale dynamically processor frequencies through the CPUfreq subsystem.
When your processors operate at a lower clock speed, they consume proportionately less power and generate less heat.
What does it mean for BeagleBone, you can switch dynamically between 500 and 275 MHz and the best you can do it live.
Required package: cpufrequtils
Determine the minimum and maximum CPU frequency allowed:
cpufreq-info -l |
When you set up SetCPU you have 5 different options as what to set the CPU-governor at. Default is “ondemand”
The options are:
-conservative
-userspace
-powersave
-ondemand
-performance
Example:
cpufreq-set -g powersave |
Set frequency:
cpufreq-set -f 500 |
Now you are able to set CPU frequency from userspace:
# 500 MHz
1 | echo 500000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed |
# set back to 275 MHz
1 | echo 275000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed |
Avoid unnecessary read&write accesses to your SD-card:
If you are using your BeagleBone system only for development or demo, you can complete disable logging (rsyslog) on your system and remove your log files: (“/var/log/*”).
Another way you move your temporarily file like logs to tmpfs:
Add this three lines to /etc/fstab:
1 2 3 | tmpfs /var/log tmpfs defaults 0 0 tmpfs /tmp tmpfs defaults 0 0 tmpfs /var/tmp tmpfs defaults 0 0 |
Finally stop all services that operating with “/var/log” and “/var/tmp” reload fstab (yeah without any reboot):
mount -a |
And at least you minimize the wear of your SD card;)
Swappiness
Try to avoid to write to SD-Card use more your RAM.
0: Kernel will avoid to put something in to your swap
100: Kernel will swap everything and really often in to your swap
See your actual swappiness value:
cat /proc/sys/vm/swappiness |
Set swappiness behavior to 10
sysctl vm.swappiness=10 |
To make this setting reboot save put in to:
/etc/sysctl.conf |
Power Top
PowerTOP is a Linux tool to diagnose issues with power consumption and power management
Install powertop:
apt-get install powertop |
Some really good Resources:
[IBM] Reduce Linux power consumption – The CPUfreq subsystem
[…] older post for BeagleBone power consumption optimisation is a pretty good base for this […]