Fix kernel tweaks
This commit is contained in:
@@ -12,6 +12,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|||||||
|
|
||||||
- MySQL configuration tuning
|
- MySQL configuration tuning
|
||||||
- Cronjob to optimize MySQL databases weekly
|
- Cronjob to optimize MySQL databases weekly
|
||||||
|
- wo-kernel systemd service to apply kernel tweaks on server startup
|
||||||
|
|
||||||
#### Changed
|
#### Changed
|
||||||
|
|
||||||
@@ -19,6 +20,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|||||||
- Improved debug log
|
- Improved debug log
|
||||||
- Updated Nginx configuration process to not overwrite files with custom data (htpasswd-wo, acl.conf etc..)
|
- Updated Nginx configuration process to not overwrite files with custom data (htpasswd-wo, acl.conf etc..)
|
||||||
|
|
||||||
|
#### Fixed
|
||||||
|
|
||||||
|
- Kernel tweaks were not applied without server reboot
|
||||||
|
|
||||||
### v3.9.6.2 - 2019-07-24
|
### v3.9.6.2 - 2019-07-24
|
||||||
|
|
||||||
#### Changed
|
#### Changed
|
||||||
|
|||||||
13
install
13
install
@@ -453,11 +453,12 @@ wo_upgrade_nginx() {
|
|||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
if [ "$wo_distro_version" == "jessie" ]; then
|
if [ "$wo_distro_version" == "jessie" ]; then
|
||||||
|
# import the respository key for updates
|
||||||
curl -sL https://download.opensuse.org/repositories/home:virtubox:WordOps/Debian_8.0/Release.key | apt-key add -
|
curl -sL https://download.opensuse.org/repositories/home:virtubox:WordOps/Debian_8.0/Release.key | apt-key add -
|
||||||
else
|
else
|
||||||
curl -sL https://download.opensuse.org/repositories/home:virtubox:WordOps/Debian_9.0/Release.key | apt-key add -
|
curl -sL https://download.opensuse.org/repositories/home:virtubox:WordOps/Debian_9.0/Release.key | apt-key add -
|
||||||
fi
|
fi
|
||||||
# import the respository key for updates
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# stop nginx
|
# stop nginx
|
||||||
@@ -649,6 +650,16 @@ wo_tweak_kernel() {
|
|||||||
modprobe tcp_htcp && echo 'tcp_htcp' >> /etc/modules-load.d/htcp.conf
|
modprobe tcp_htcp && echo 'tcp_htcp' >> /etc/modules-load.d/htcp.conf
|
||||||
echo 'net.ipv4.tcp_congestion_control = htcp' >> /etc/sysctl.d/60-wo-tweaks.conf
|
echo 'net.ipv4.tcp_congestion_control = htcp' >> /etc/sysctl.d/60-wo-tweaks.conf
|
||||||
fi
|
fi
|
||||||
|
# apply sysctl tweaks
|
||||||
|
sysctl -e -p /etc/sysctl.d/60-wo-tweaks.conf
|
||||||
|
if [ ! -x /opt/wo-kernel.sh ]; then
|
||||||
|
# download and setup wo-kernel systemd service to apply kernel tweaks for netdata and redis on server startup
|
||||||
|
wget -qO /opt/wo-kernel.sh https://raw.githubusercontent.com/WordOps/WordOps/updating-configuration/wo/cli/templates/wo-kernel-script.mustache
|
||||||
|
chmod +x /opt/wo-kernel.sh
|
||||||
|
wget -qO /lib/systemd/system/wo-kernel.service https://raw.githubusercontent.com/WordOps/WordOps/updating-configuration/wo/cli/templates/wo-kernel-service.mustache
|
||||||
|
systemctl enable wo-kernel.service
|
||||||
|
systemctl start wo-kernel.service
|
||||||
|
fi
|
||||||
|
|
||||||
fi
|
fi
|
||||||
LIMIT_CHECK=$(grep "500000" /etc/security/limits.conf)
|
LIMIT_CHECK=$(grep "500000" /etc/security/limits.conf)
|
||||||
|
|||||||
@@ -1,13 +0,0 @@
|
|||||||
[Unit]
|
|
||||||
Description=Linux kernel tweaks
|
|
||||||
|
|
||||||
# append here other services you want netdata to wait for them to start
|
|
||||||
After=network.target
|
|
||||||
|
|
||||||
[Service]
|
|
||||||
Type=simple
|
|
||||||
User=root
|
|
||||||
ExecStart=/opt/kerneltweaks.sh
|
|
||||||
|
|
||||||
[Install]
|
|
||||||
WantedBy=multi-user.target
|
|
||||||
@@ -1,7 +1,9 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
# Kernel tweak script launched by kerneltweak systemd service
|
# WordOps Kernel tweaks script
|
||||||
# script path after installation /opt/kerneltweaks.sh
|
# script path after installation /opt/wo-kernel.sh
|
||||||
|
|
||||||
|
# Netdata Memory tweak
|
||||||
echo 1 >/sys/kernel/mm/ksm/run
|
echo 1 >/sys/kernel/mm/ksm/run
|
||||||
echo 1000 >/sys/kernel/mm/ksm/sleep_millisecs
|
echo 1000 >/sys/kernel/mm/ksm/sleep_millisecs
|
||||||
|
# Redis disable transparent_hugepage
|
||||||
echo never > /sys/kernel/mm/transparent_hugepage/enabled
|
echo never > /sys/kernel/mm/transparent_hugepage/enabled
|
||||||
14
wo/cli/templates/wo-kernel-service.mustache
Normal file
14
wo/cli/templates/wo-kernel-service.mustache
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=WordOps kernel tweaks
|
||||||
|
# append here other services you want netdata to wait for them to start
|
||||||
|
After=syslog.target network.target remote-fs.target nss-lookup.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=simple
|
||||||
|
User=root
|
||||||
|
ExecStart=/opt/wo-kernel.sh
|
||||||
|
StandardOutput=null
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
|
Alias=wo-kernel.service
|
||||||
Reference in New Issue
Block a user