centos最大文件限制數ulimit修改

  1. centos最大文件數,系統一般默認爲1024
    查看命令:

    ulimit -n

  2. ulimit最大文件打開數的全局設置

    vim /etc/security/limits.conf

    在最後添加

    root soft nofile 65535
    root hard nofile 65535
    * soft nofile 65535
    * hard nofile 65535
    

    “*”表示所有用戶都生效

  3. reboot 重啓生效
    此時再執行ulimit -n 顯示65535

這個設置解決Nginx:too man open files 報錯

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章