Enable socket recycle and reuse, connection settings:
# as root
echo "net.ipv4.tcp_tw_recycle = 1" >> /etc/sysctl.conf
echo "net.ipv4.tcp_tw_reuse = 1" >> /etc/sysctl.conf
echo "net.core.somaxconn = 1024" >> /etc/sysctl.conf
Enable zswap, tweak swappiness:
# as root
echo "vm.swappiness=10" >> /etc/sysctl.conf
vim /etc/default/grub
# GRUB_CMDLINE_LINUX_DEFAULT="zswap.enabled=1 zswap.zpool=z3fold zswap.compressor=lz4"
update-grub
echo z3fold >> /etc/initramfs-tools/modules
echo lz4 >> /etc/initramfs-tools/modules
echo lz4_compress >> /etc/initramfs-tools/modules
update-initramfs -u
# restart server
cat /sys/fs/cgroup/memory/memory.swappiness
grep --dereference-recursive . /sys/module/zswap/parameters