Chinaunix首页 | 论坛 | 博客
  • 博客访问: 29419127
  • 博文数量: 2065
  • 博客积分: 10377
  • 博客等级: 上将
  • 技术积分: 21525
  • 用 户 组: 普通用户
  • 注册时间: 2008-11-04 17:50
文章分类

全部博文(2065)

文章存档

2012年(2)

2011年(19)

2010年(1160)

2009年(969)

2008年(153)

分类: LINUX

2010-08-26 22:15:29

从 七猫的藏经阁 作者:Diviner
To support over 500k users, you *need*

- A 64 bits hardware/kernel (AMD64, Opterons)
- At least 8GB of ram
- A recent linux kernel (2.6.x)

About tuning, I prefer to not fully disclose them because servers are targets of many attacks, so it's better not help hackers.

The most touchy thing is the IP route cache : You have to tune it or else the machine drops many connections

(hint : rhash_entries=... in the boot append string)
hints :
echo 1 > /proc/sys/net/ipv4/route/gc_interval
echo 150 >/proc/sys/net/ipv4/route/gc_timeout
echo 2 >/proc/sys/net/ipv4/route/gc_elasticity

- Use of hugeTLB pages
hint :
echo xxx >/proc/sys/vm/nr_hugepages

Tune tcp :
echo "4096 49152 131072" >/proc/sys/net/ipv4/tcp_wmem
echo xxxx >/proc/sys/net/ipv4/tcp_max_syn_backlog
echo xxxx >/proc/sys/net/core/somaxconn
echo 1200000 > /proc/sys/net/ipv4/tcp_max_tw_buckets
echo 7 >/proc/sys/net/ipv4/tcp_retries2
echo "600000 650000 700000" >/proc/sys/net/ipv4/tcp_mem
echo 0 >/proc/sys/net/ipv4/tcp_timestamps
echo 0 >/proc/sys/net/ipv4/tcp_window_scaling
echo 0 >/proc/sys/net/ipv4/tcp_sack
echo 330000 >/proc/sys/net/ipv4/tcp_max_orphans
echo "10000 62000" >/proc/sys/net/ipv4/ip_local_port_range


others :
echo 1300000 >/proc/sys/fs/file-max
阅读(1072) | 评论(0) | 转发(0) |
0

上一篇:今日新闻2010-08-26

下一篇:Etag和Expires

给主人留下些什么吧!~~