百萬級並發串連_linux伺服器配置

來源:互聯網
上載者:User
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

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.