Posts linux configure ulimit
Post
Cancel

linux configure ulimit

  • Create file called limits.conf
1
$ touch limits.conf
  • Add limits configuration to the limits.conf

Assuming user that you want to increase limits for is called ‘java’

1
2
$ echo "java soft nofile 8196" > limits.conf
$ echo "java hard nofile 65536" >> limits.conf
  • Move file to /etc/security
1
$ sudo mv limits.conf /etc/security
  • if file already exists in /etc/security

Then directly append contents to the file

1
2
$ sudo echo "java soft nofile 8196" >> limits.conf
$ sudo echo "java hard nofile 65536" >> limits.conf
  • Verify that limits have been applied correctly
1
2
3
4
5
$ ulimit -Hn
unlimited

$ ulimit -Sn
8196
This post is licensed under CC BY 4.0 by the author.