sysctl
Add permanent setting
echo "vm.max_map_count=262144" >> /etc/sysctl.d/99-sysctl.conf
sysctl --system
sysctl vm.max_map_count
Set socket maximum connection
/etc/sysctl.conf
net.core.somaxconn=1024
sysctl -p
Set memory overcommit
/etc/sysctl.conf
vm.overcommit_memory = 1
sysctl -p
Change network congestion-control algorithms
When a route has substantial packet loss/congestion/reordering when pushed hard CUBIC could perform very poorly. Switching to BBR could help.
Create a module-load configuration so tcp_bbr is available early at boot:
echo tcp_bbr > /etc/modules-load.d/bbr.conf
Then create:
cat >/etc/sysctl.d/99-bbr.conf <<'EOF'
net.core.default_qdisc=fq
net.ipv4.tcp_congestion_control=bbr
EOF
Apply it:
sysctl --system