Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
- # cpufreq settings
- echo -e "OMV_CPUFREQUTILS_GOVERNOR=ondemand" >>/etc/default/openmediavault
- echo -e "OMV_CPUFREQUTILS_MINSPEED=240000" >>/etc/default/openmediavault
- echo -e "OMV_CPUFREQUTILS_MAXSPEED=912000" >>/etc/default/openmediavault
- apt install -y cpufrequtils
- echo -e "ENABLE=true\nMIN_SPEED=240000\nMAX_SPEED=912000\nGOVERNOR=ondemand" >/etc/default/cpufrequtils
- sed -i '/^exit\ 0/i \
- echo ondemand >/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor \
- sleep 0.1 \
- cd /sys/devices/system/cpu \
- for i in cpufreq/ondemand cpu0/cpufreq/ondemand cpu4/cpufreq/ondemand ; do \
- if [ -d $i ]; then \
- echo 1 >${i}/io_is_busy \
- echo 25 >${i}/up_threshold \
- echo 10 >${i}/sampling_down_factor \
- fi \
- done \
- ' /etc/rc.local
- # Samba settings
- . /usr/share/openmediavault/scripts/helper-functions
- SMB_Options="min receivefile size = 16384\nwrite cache size = 524288\ngetwd cache = yes\nsocket options = TCP_NODELAY IPTOS_LOWDELAY"
- xmlstarlet ed -L -u "/config/services/smb/extraoptions" -v "$(echo -e "${SMB_Options}")" ${OMV_CONFIG_FILE}
- # Disable monitoring
- /usr/sbin/omv-rpc -u admin "perfstats" "set" '{"enable":false}'
- /usr/sbin/omv-rpc -u admin "config" "applyChanges" '{ "modules": ["monit","rrdcached","collectd"],"force": true }'
- # Tweak IO scheduler/priority
- echo "* * * * * root for i in \`pgrep \"ftpd|nfsiod|smbd|afpd|cnid\"\` ; do ionice -c1 -p \$i ; done >/dev/null 2>&1" >/etc/cron.d/make_nas_processes_faster
- chmod 600 /etc/cron.d/make_nas_processes_faster
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement