vi /etc/sysctl.conf
The add the following.
# Added by Allan Start # # # Number of times SYNACKs for passive TCP connection. net.ipv4.tcp_synack_retries = 2 # Protect Against TCP Time-Wait net.ipv4.tcp_rfc1337 = 1 # Control Syncookies net.ipv4.tcp_syncookies = 1 # Decrease the time default value for tcp_fin_timeout connection net.ipv4.tcp_fin_timeout = 15 # Decrease the time default value for connections to keep alive net.ipv4.tcp_keepalive_time = 300 net.ipv4.tcp_keepalive_probes = 5 net.ipv4.tcp_keepalive_intvl = 15 # Increase number of incoming connections net.core.somaxconn = 1024 # Increase number of incoming connections backlog net.core.netdev_max_backlog = 65536 # Increase the tcp-time-wait buckets pool size to prevent simple DOS attacks net.ipv4.tcp_max_tw_buckets = 1440000 net.ipv4.tcp_tw_recycle = 1 net.ipv4.tcp_tw_reuse = 1 # Enable timestamps as defined in RFC1323: net.ipv4.tcp_timestamps = 1 # Maximum number of remembered connection requests, which did not yet # receive an acknowledgment from connecting client. # net.ipv4.tcp_max_syn_backlog = 1024 # # # Added by Allan Stop