out of socket memory相關tcp參數

來源:互聯網
上載者:User

out of socket memory調整

主要是調整TCP緩衝區

Increasing the TCP send and receive buffers will increase the performance a lot if (and only if) you have a lot of large files to send.

增加TCP 發送和接收緩衝區對效能有很大的提高,在你有大檔案發送的情況下

net.ipv4.tcp_wmem = 4096 65536 524288

net.core.wmem_max = 1048576

If you have a lot of large file uploads, increasing the receive buffers will help.

如果你有大檔案上傳,增大接收緩衝區對給你帶來協助

net.ipv4.tcp_rmem = 4096 87380 524288

net.core.rmem_max = 1048576

# These ensure that TIME_WAIT ports either get reused or closed fast.

以下參數確保TIME_WAIT 快速關閉

net.ipv4.tcp_fin_timeout = 1   ##開啟fin_wait 快速關閉參數

net.ipv4.tcp_tw_recycle = 1    ##快速回收fin_wait參數

設定核心TCP的相關參數

# TCP memory

net.core.rmem_max = 16777216    ##核心最大接收緩衝 16M

net.core.rmem_default = 16777216  ##核心黙認接收緩衝 16M

net.core.netdev_max_backlog = 262144   ##2M

net.core.somaxconn = 262144    ##2M

net.ipv4.tcp_syncookies = 1      ##開啟SYN_COOKIE

net.ipv4.tcp_max_orphans = 262144 ##2M

net.ipv4.tcp_max_syn_backlog = 262144 ##SYN 隊列大小 2M

net.ipv4.tcp_synack_retries = 2 ##SYN_ACK重試時間 2秒

net.ipv4.tcp_syn_retries = 2   ## SYN 重試時間   2秒

# you shouldn't be using conntrack on a heavily loaded server anyway, but these are

# suitably high for our uses, insuring that if conntrack gets turned on, the box doesn’t die

如果用到IPTABLES 同樣在增長ip_conntrack 的大小,這個是iptables 所管理的狀態數目

net.ipv4.ip_conntrack_max = 1048576

net.ipv4.netfilter.ip_conntrack_max = 1048576

原文:

http://hi.baidu.com/lewutian/item/b7fe3cc56f966345a8ba94c2

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.