Thursday, October 22, 2009

Using /etc/security/limits.conf to restrict processes and memory

The configuration file at /etc/security/limits.conf help in settings limits to processes or logins oe more. This helps in preventing a rogue applications in consuming too much processes that might cause the servers to crash.

* soft nproc 400
* hard nproc 500

(If you hit 400 processes, the system will warn you. If you hit 500, the system will block you) 

Alternatively if you do not wish to set a limit to the number of processes that can be run on your servers due to the particular application, you can also

* soft nproc unlimited
* hard nproc unlimited
You do not need to reboot to effect the settings, just relogin and the users will be subjected to the /etc/security/limits.conf configuration file

No comments: