修改ulimit最佳化伺服器

來源:互聯網
上載者:User

修改ulimit最佳化伺服器 預設linux系統的檔案描述符是1024,在大負載的情況下這點檔案描述符是遠遠不夠的,以下兩種方法: 一,通過ulimit命令修改  #顯示當前檔案描述符ulimit -n #修改目前使用者環境下的檔案描述符為65536ulimit -HSn 65536隻能修改當前登入使用者環境下的檔案描述符,如果此使用者來另外開啟一個串連,此連結環境的檔案描述符依然是沒改前的。如果系統重啟,以前修改都不再生效 二,通過修改limits.conf檔案1.開啟/etc/security/limits.conf,裡面有很詳細的注釋,找到如下設定(如果沒有就插入)* soft nofile 65536* hard nofile 65536 2.編輯/etc/pam.d/common-session,加入一行session required pam_limits.so3.編輯/etc/profile,加入ulimit -SHn 65536 

聯繫我們

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