Skip to content

Instantly share code, notes, and snippets.

@iammehrabalam
Last active July 30, 2016 15:16
Show Gist options
  • Save iammehrabalam/c2bbdf2dc3aee11bfefc89c9e644bcc9 to your computer and use it in GitHub Desktop.
Save iammehrabalam/c2bbdf2dc3aee11bfefc89c9e644bcc9 to your computer and use it in GitHub Desktop.
Linux system tuning
#!/bin/bash
# file descriptor
# Change 400000 to increase or decrease number of file descriptor
echo "* soft nofile 400000" >> /etc/security/limits.conf
echo "* hard nofile 400000" >> /etc/security/limits.conf
# Changing kernal parameters (modify value if required)
echo "net.core.somaxconn = 262144" >> /etc/sysctl.conf
echo "net.ipv4.tcp_max_syn_backlog = 16384" >> /etc/sysctl.conf
echo "net.core.netdev_max_backlog = 655360" >> /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_tw_recycle = 1" >> /etc/sysctl.conf
echo "net.ipv4.tcp_tw_reuse = 1" >> /etc/sysctl.conf
echo "net.ipv4.ip_local_port_range = 1024 65535" >> /etc/sysctl.conf
sysctl -p
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment