增加CentOS File Descriptors

來源:互聯網
上載者:User

在使用CentOS做server的時候有時會碰到server拒絕client串連的情況,client會受到connection reset by peer等錯誤,究其原因應該是server預設的file descriptor為1024,此時已經超過了1024,為安全起見server拒絕服務所導致的。
增加file descriptor的操作如下:
一、臨時增加file descriptor
  ulimit -n 4096
二、永久增加file descriptor
  2.1 # vi /etc/sysctl.conf
  2.2 增加 fs.file-max = 100000
  2.3 重啟或者執行 # sysctl -p
  2.4 # vi /etc/security/limits.conf
  2.5 增加 *       -       nofile  100000
  2.6 通過ulimit -n來校正file descriptor

參考資料:
  http://www.cyberciti.biz/faq/linux-increase-the-maximum-number-of-open-files/
  http://sdb.open-xchange.com/node/35
  http://thedaneshproject.com/posts/how-to-increase-total-file-descriptors-count-on-linux/
  http://www.centos.org/docs/5/html/CDS/install/8.0/Installation_Guide-Support-Platforms.html
  
  

相關文章

聯繫我們

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