Put custom sysctl params in a separate config file
Previously, the build script kept appending to the main config
file each time.
@@ -117,16 +117,19 @@ increaseconnections()
# the modprobe command fails.
modprobe ip_conntrack || true
- echo "net.netfilter.nf_conntrack_max = 262144" >> /etc/sysctl.conf
- echo "net.core.somaxconn = 20240" >> /etc/sysctl.conf
- echo "net.ipv4.tcp_tw_recycle = 0" >> /etc/sysctl.conf
- echo "net.ipv4.tcp_tw_reuse = 0" >> /etc/sysctl.conf
- echo "net.ipv4.tcp_orphan_retries = 1" >> /etc/sysctl.conf
- echo "net.ipv4.tcp_fin_timeout = 25" >> /etc/sysctl.conf
- echo "net.ipv4.tcp_max_orphans = 8192" >> /etc/sysctl.conf
- echo "net.ipv4.ip_local_port_range = 32768 61000" >> /etc/sysctl.conf
-
- /sbin/sysctl -p /etc/sysctl.conf
+ SYSCTL_CONFIG="/etc/sysctl.d/10-appscale.conf"
+ cat << EOF > ${SYSCTL_CONFIG}
+net.netfilter.nf_conntrack_max = 262144
+net.core.somaxconn = 20240
+net.ipv4.tcp_tw_recycle = 0
+net.ipv4.tcp_tw_reuse = 0
+net.ipv4.tcp_orphan_retries = 1
+net.ipv4.tcp_fin_timeout = 25
+net.ipv4.tcp_max_orphans = 8192
+net.ipv4.ip_local_port_range = 32768 61000
+EOF
+
+ sysctl -p ${SYSCTL_CONFIG}
fi
}
