centos 6 ulimit修改及sysctl配置

來源:互聯網
上載者:User

標籤:style   color   使用   os   io   檔案   ar   log   

cat <<EOF >>/etc/security/limits.conf

* soft nofile 65536

* hard nofile 65536

* soft nproc unlimited

* hard nproc unlimited

EOF


cat <<EOF >>/etc/security/limits.d/90-nproc.conf

*          soft    nproc     unlimited

root       soft    nproc     unlimited

EOF


重新登入機器生效


cat <<EOF >>/etc/sysctl.conf

net.ipv4.tcp_fin_timeout = 30

net.ipv4.tcp_keepalive_time = 300

net.ipv4.tcp_syncookies = 1

net.ipv4.tcp_synack_retries = 2

net.ipv4.tcp_tw_reuse = 1

net.ipv4.tcp_tw_recycle = 1

net.ipv4.tcp_max_syn_backlog = 4096

net.ipv4.tcp_max_tw_buckets=50000

net.nf_conntrack_max=6553600

net.netfilter.nf_conntrack_max=6553600


sysctl -p 執行生效


報錯:

error: "net.bridge.bridge-nf-call-ip6tables" is an unknown key

error: "net.bridge.bridge-nf-call-iptables" is an unknown key

error: "net.bridge.bridge-nf-call-arptables" is an unknown key

 

解決方案如下:

modprobe bridge

echo "modprobe bridge" >>/etc/rc.local



error: "net.ipv4.ip_conntrack_max" is an unknown key

error: "net.ipv4.netfilter.ip_conntrack_max" is an unknown key

error: "net.ipv4.netfilter.ip_conntrack_tcp_timeout_established" is an unknown key


解決:

modprobe ip_conntrack

echo "modprobe ip_conntrack" >> /etc/rc.local


modprobe(module probe)


功能說明:自動處理可載入模組.


語  法:modprobe [-acdlrtvV][--help][模組檔案][符號名稱 = 符號值]


補充說明:modprobe可載入指定的個別模組,或是載入一組相依的模組.modprobe會根據depmod所產生的相依關係,決定要載入哪些模組.若在載入過程中發生錯誤,在modprobe會卸載整組的模組.


參  數:

-a或--all  載入全部的模組.

-c或--show-conf  顯示所有模組的設定資訊.

-d或--debug  使用排錯模式.

-l或--list  顯示可用的模組.

-r或--remove  模組閑置不用時,即自動卸載模組.

-t或--type  指定模組類型.

-v或--verbose  執行時顯示詳細的資訊.

-V或--version  顯示版本資訊.

-help  顯示協助.



centos5 netfilter 參數設定檔目錄:/proc/sys/net/ipv4/netfilter/ip_conntrack_max

centos6 netfilter 參數設定檔目錄:/proc/sys/net/netfilter/nf_conntrack_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.