blob: d85935af1a81abd41ea4ad2b685d388ccedc76be [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
willy tarreaue39cd132005-12-17 13:00:18 +010011if [ -e /proc/sys/net/ipv4/netfilter/ip_conntrack_tcp_timeout_fin_wait ]; then
willy tarreaub719f002005-12-17 12:55:07 +010012 # 30 seconds for fin, 15 for time wait
willy tarreaue39cd132005-12-17 13:00:18 +010013 echo 3000 > /proc/sys/net/ipv4/netfilter/ip_conntrack_tcp_timeout_fin_wait
14 echo 1500 > /proc/sys/net/ipv4/netfilter/ip_conntrack_tcp_timeout_time_wait
15 echo 0 > /proc/sys/net/ipv4/netfilter/ip_conntrack_tcp_log_invalid_scale
16 echo 0 > /proc/sys/net/ipv4/netfilter/ip_conntrack_tcp_log_out_of_window
willy tarreaub719f002005-12-17 12:55:07 +010017fi
18
19echo 1024 60999 > /proc/sys/net/ipv4/ip_local_port_range
willy tarreau240afa62005-12-17 13:14:35 +010020#echo 32768 > /proc/sys/net/ipv4/ip_queue_maxlen
willy tarreaub719f002005-12-17 12:55:07 +010021echo 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