0

On CentOS7 I am trying to change the values of ulimit as following:

ulimit -Hn 262144
ulimit -Sn 100000

But the value is being reset to its default values just after signing out:

[root@server001]# ulimit -Hn
4096
[root@server001]# ulimit -Sn
1024

Am I setting the values permanently this way? if not, how to do it?

And if it is permanent, why it is coming back to its default value?

Eng7
  • 127
  • 1
  • 7

1 Answers1

1

If you set limits with the ulimit command, your changes will remain effective only until log out or reboot. It's the observed behavior.

To change limits permanently you have to edit /etc/security/limits.conf.

Here is how to set the values for soft and hard number of open files for everyone (*).

*               soft    nofile          100000
*               hard    nofile          262144

For the changes to take effect you need to log out and re-login.

More info in the man page

Romain
  • 207
  • 1
  • 6