Skip to content

Instantly share code, notes, and snippets.

@sandikata
Created June 16, 2016 08:36
Show Gist options
  • Save sandikata/cf89759145956629fea89b3e61691f5d to your computer and use it in GitHub Desktop.
Save sandikata/cf89759145956629fea89b3e61691f5d to your computer and use it in GitHub Desktop.
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
# Performance Tuning
echo 1 > /sys/kernel/mm/ksm/run
echo 100 > /sys/kernel/mm/ksm/sleep_millisecs
echo 0 > /sys/block/sda/queue/add_random
echo 2 > /sys/block/sda/queue/rq_affinity
# CPU Settings
for x in /sys/devices/system/cpu/cpu[0-3]/cpufreq; do echo 1100000 > $x/scaling_min_freq; done
for y in /sys/devices/system/cpu/cpu[0-3]/cpufreq; do echo 2100000 > $y/scaling_max_freq; done
echo 1 > /sys/module/processor/parameters/ignore_ppc
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment