From terminal in ubuntu, change ulimit for file descriptor number

后端 未结 1 697
暖寄归人
暖寄归人 2021-01-06 20:03

Fron the terminal I am trying to change the number of file descriptions open and they will not stick. How, from the terminal do I change the ulimit? Per the below, when I r

相关标签:
1条回答
  • 2021-01-06 20:27

    I had a similar issue when trying to raise the number of file descriptors for Nginx. I had to change nofile in /etc/security/limits.conf for the www-data user:

    www-data    hard    nofile    16384
    www-data    soft    nofile    16384
    

    After this change ulimit still showed a limit of 1024. The solution was to enable *pam_limits* in /etc/pam.d/su. I just uncommented the line:

    session    required    pam_limits.so
    

    Changing this value didn't require a restart, I just logged in as www-data again. Now, running ulimit -a revealed the value 16384.

    Hope this helps.

    0 讨论(0)
提交回复
热议问题