Skip to content

Instantly share code, notes, and snippets.

@EmmaEwert
Created September 15, 2018 18:33
Show Gist options
  • Save EmmaEwert/5dcf3cc623d254feaf8f5b0c523955a4 to your computer and use it in GitHub Desktop.
Save EmmaEwert/5dcf3cc623d254feaf8f5b0c523955a4 to your computer and use it in GitHub Desktop.

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment