Skip to content

Instantly share code, notes, and snippets.

@TotalLag
Last active December 16, 2019 19:16
Show Gist options
  • Select an option

  • Save TotalLag/0e67004ee1c3cb940a0e to your computer and use it in GitHub Desktop.

Select an option

Save TotalLag/0e67004ee1c3cb940a0e to your computer and use it in GitHub Desktop.
#!/bin/bash
sudo su
ulimit -n 99999
echo '* hard nofile 500000' >> /etc/security/limits.conf
echo '* soft nofile 500000' >> /etc/security/limits.conf
echo 'root hard nofile 500000' >> /etc/security/limits.conf
echo 'root soft nofile 500000' >> /etc/security/limits.conf
echo 0 > /sys/block/vda/queue/rotational
echo 0 > /sys/block/vda/queue/rq_affinity
echo noop > /sys/block/vda/queue/scheduler
echo "echo 0 > /sys/block/vda/queue/rotational" >> /etc/rc.local
echo "echo 0 > /sys/block/vda/queue/rq_affinity" >> /etc/rc.local
echo "echo noop > /sys/block/vda/queue/scheduler" >> /etc/rc.local
echo 'vm.swappiness=5' >> /etc/sysctl.conf
echo 'vm.vfs_cache_pressure=50' >> /etc/sysctl.conf
echo 'net.core.rmem_max=16777216' >> /etc/sysctl.conf
echo 'net.core.wmem_max=16777216' >> /etc/sysctl.conf
echo 'net.ipv4.tcp_rmem=4096 87380 16777216' >> /etc/sysctl.conf
echo 'net.ipv4.tcp_wmem=4096 65536 16777216' >> /etc/sysctl.conf
echo 'fs.file-max=100000' >> /etc/sysctl.conf
sysctl -p
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment