blob: 76875eaec39f4847fd536ef8f079f2c160c8354e [file] [log] [blame]
willy tarreaub719f002005-12-17 12:55:07 +01001#!/bin/sh
2# set this to about 256/4M (16384 for 256M machine)
3MAXFILES=16384
4echo $MAXFILES > /proc/sys/fs/file-max
5ulimit -n $MAXFILES
6
7if [ -e /proc/sys/net/ipv4/ip_conntrack_max ]; then
8 echo 65536 > /proc/sys/net/ipv4/ip_conntrack_max
9fi
10
11if [ -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
17fi
18
19echo 1024 60999 > /proc/sys/net/ipv4/ip_local_port_range
20echo 32768 > /proc/sys/net/ipv4/ip_queue_maxlen
21echo 30 > /proc/sys/net/ipv4/tcp_fin_timeout
22echo 4096 > /proc/sys/net/ipv4/tcp_max_syn_backlog
23echo 262144 > /proc/sys/net/ipv4/tcp_max_tw_buckets
24echo 262144 > /proc/sys/net/ipv4/tcp_max_orphans
25echo 300 > /proc/sys/net/ipv4/tcp_keepalive_time
26echo 1 > /proc/sys/net/ipv4/tcp_tw_recycle
27echo 0 > /proc/sys/net/ipv4/tcp_timestamps
28echo 0 > /proc/sys/net/ipv4/tcp_ecn
29echo 0 > /proc/sys/net/ipv4/tcp_sack
30echo 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
36echo 16384 65536 524288 > /proc/sys/net/ipv4/tcp_rmem
37echo 16384 349520 699040 > /proc/sys/net/ipv4/tcp_wmem
38