| 1 | = System configuration & Kernel tweaks = |
| 2 | |
| 3 | 参数优化:/etc/sysctl.conf |
| 4 | {{{ |
| 5 | net.ipv4.ip_default_ttl = 255 |
| 6 | net.ipv4.icmp_echo_ignore_broadcasts = 1 |
| 7 | net.ipv4.icmp_ignore_bogus_error_responses = 1 |
| 8 | |
| 9 | net.ipv4.tcp_max_tw_buckets = 262144 |
| 10 | net.ipv4.ip_local_port_range = 1024 65535 |
| 11 | |
| 12 | # Do not use swap ASAP |
| 13 | vm.swappiness = 0 |
| 14 | |
| 15 | # TCP socket keepalive check every minute, if fail check every 10 seconds and 3 times |
| 16 | net.ipv4.tcp_keepalive_time = 60 |
| 17 | net.ipv4.tcp_keepalive_intvl = 10 |
| 18 | net.ipv4.tcp_keepalive_probes = 3 |
| 19 | |
| 20 | net.ipv4.tcp_fin_timeout = 30 |
| 21 | }}} |
| 22 | |
| 23 | 参数优化:/etc/security/limits.conf |
| 24 | {{{ |
| 25 | * - nofile 65535 |
| 26 | * - nproc 65535 |
| 27 | }}} |
| 28 | |
| 29 | 更多的参数优化,可参考如下: |
| 30 | http://tengine.taobao.org/document/benchmark.html |
| 31 | |