centos/redhat: change open files ulimit without reboot?

25,634

You can just change it as root. For example:

$ ulimit -n  
4096
$ ulimit -n 8192
bash: ulimit: open files: cannot modify limit: Operation not permitted
$ sudo bash                    
# ulimit -n                    
4096
# ulimit -n 8192                  
# su - normaluser                 
$ ulimit -n                       
8192
Share:
25,634
user3531602
Author by

user3531602

Updated on September 18, 2022

Comments

  • user3531602
    user3531602 almost 2 years

    The hard limit of the number of open files is set to 1024 on my machine.

    • I changed /etc/security/limits.conf and added 'idror hard nofile 65000'.
    • In my shell I tried ulimit -n 65000. I get 'ulimit: value exceeds hard limit'
    • In my shell I tried ulimit -Hn 65000. I get 'ulimit: can't raise hard limits'

    So how can I increase the setting for the limit of open files without reboot?

    • Admin
      Admin over 11 years
      After a limits.conf change, you need to log out and back in.