willy tarreau | b719f00 | 2005-12-17 12:55:07 +0100 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | # set this to about 256/4M (16384 for 256M machine) |
| 3 | MAXFILES=16384 |
| 4 | echo $MAXFILES > /proc/sys/fs/file-max |
| 5 | ulimit -n $MAXFILES |
| 6 | |
| 7 | if [ -e /proc/sys/net/ipv4/ip_conntrack_max ]; then |
| 8 | echo 65536 > /proc/sys/net/ipv4/ip_conntrack_max |
| 9 | fi |
| 10 | |
| 11 | if [ -e /proc/sys/net/ipv4/netfilter/ip_ct_tcp_timeout_fin_wait ]; then |
| 12 | # 30 seconds for fin, 15 for time wait |
| 13 | echo 3000 > /proc/sys/net/ipv4/netfilter/ip_ct_tcp_timeout_fin_wait |
| 14 | echo 1500 > /proc/sys/net/ipv4/netfilter/ip_ct_tcp_timeout_time_wait |
| 15 | echo 0 > /proc/sys/net/ipv4/netfilter/ip_ct_tcp_log_invalid_scale |
| 16 | echo 0 > /proc/sys/net/ipv4/netfilter/ip_ct_tcp_log_out_of_window |
| 17 | fi |
| 18 | |
| 19 | echo 1024 60999 > /proc/sys/net/ipv4/ip_local_port_range |
| 20 | echo 32768 > /proc/sys/net/ipv4/ip_queue_maxlen |
| 21 | echo 30 > /proc/sys/net/ipv4/tcp_fin_timeout |
| 22 | echo 4096 > /proc/sys/net/ipv4/tcp_max_syn_backlog |
| 23 | echo 262144 > /proc/sys/net/ipv4/tcp_max_tw_buckets |
| 24 | echo 262144 > /proc/sys/net/ipv4/tcp_max_orphans |
| 25 | echo 300 > /proc/sys/net/ipv4/tcp_keepalive_time |
| 26 | echo 1 > /proc/sys/net/ipv4/tcp_tw_recycle |
| 27 | echo 0 > /proc/sys/net/ipv4/tcp_timestamps |
| 28 | echo 0 > /proc/sys/net/ipv4/tcp_ecn |
| 29 | echo 0 > /proc/sys/net/ipv4/tcp_sack |
| 30 | echo 0 > /proc/sys/net/ipv4/tcp_dsack |
| 31 | |
| 32 | # auto-tuned on 2.4 |
| 33 | #echo 262143 > /proc/sys/net/core/rmem_max |
| 34 | #echo 262143 > /proc/sys/net/core/rmem_default |
| 35 | |
| 36 | echo 16384 65536 524288 > /proc/sys/net/ipv4/tcp_rmem |
| 37 | echo 16384 349520 699040 > /proc/sys/net/ipv4/tcp_wmem |
| 38 | |