Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # cpu frequency
- echo ondemand > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
- echo 600000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
- echo 1008000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
- # echo -n 1200000 >/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
- echo 25 > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold
- echo 10 > /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor
- echo 1 > /sys/devices/system/cpu/cpufreq/ondemand/io_is_busy
- # assign all network IRQs to second CPU core
- echo 2 >/proc/irq/$(awk -F":" '/eth0/ {print $1}' </proc/interrupts)/smp_affinity
- # adjust network parameters for LAN usage
- sysctl -w net/core/rmem_max=8738000
- sysctl -w net/core/wmem_max=6553600
- sysctl -w net/ipv4/tcp_rmem="8192 873800 8738000"
- sysctl -w net/ipv4/tcp_wmem="4096 655360 6553600"
- sysctl -w vm/min_free_kbytes=65536
- ip link set eth0 txqueuelen 10000
- # load sunxi_dbgreg.ko module to read out A20's thermal sensors
- grep -q sunxi_dbgreg </proc/modules || modprobe sunxi-dbgreg
- # start temperature measurement daemon
- nohup /usr/local/bin/temp-daemon.sh &
- # fun stuff for the green led on the board -- choose/uncomment only one and
- # have a look at http://forum.lemaker.org/thread-1057-4-1-4.html for details
- # switch off green led on Banana Pi
- echo none > /sys/class/leds/green\:ph24\:led1/trigger
- # show activity of CPU0
- # echo cpu0 >/sys/class/leds/green\:ph24\:led1/trigger
- # turn on green led when there's disk access (requires sysstat package):
- # iostat -z -d 1 sda | sed -u -e '1d' -e 's/Device.*/none/' -e 's/sd.*/timer/' -e '/^$/d' >/sys/class/leds/green\:ph24\:led1/trigger &
- # use green led to show CPU's %idle state (above 90% no led, 50-89% slow
- # flashing, 10-49% faster flashing, idle below 10% constant led light):
- # iostat -c 1 | sed -u -e '1d' -e 's/avg-cpu.*//' -e '/^$/d' -e 's/^.\{1,50\}//' -e 's/[0,9].*/none/' -e 's/[5-8].*/timer/' -e 's/[1-4].*/heartbeat/' -e 's/\ .*/default-on/' >/sys/class/leds/green\:ph24\:led1/trigger &
- # use green led to show I/O bottlenecks based on the iowait percentage
- # (below 10% no led, 10%-19% slow blinking, 20%-49% fast blinking,
- # 50% or above: constant led light):
- # iostat -c 1 | sed -u -e '1d' -e 's/avg-cpu.*//' -e '/^$/d' -e 's/^.\{1,34\}//' -e 's/[0,5-9].*/default-on/' -e 's/1.*/timer/' -e 's/[2-4].*/heartbeat/' -e 's/\ .*/none/' >/sys/class/leds/green\:ph24\:led1/trigger &
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement