How to get the soft and hard limits on a running process in Linux

In Linux a running process has ulimit setup but how do you know for sure the hard ans soft limits are active? In the following I will show you how...

Published on: May 11, 2020 by Website Admin

OK, so let’s say you have a running application - Nginx for example - and you want to make sure that the soft and hard limits of that application (or user - this applies to users too) has the limits you have setup in the configuration file - usually : /etc/security/limits.conf in Linux Ubuntu and CentOS.

Remember! Some applications that are running under supervisord for example, have these limits setup in different configuration file responsible for that application so you must keep that in mind.

So the commands are:

ps -ef | grep application-name
cat /proc/PID of application-name/limits

And vualá! You now see the active limits of the application process which might look similar to this:

If that does not coincide with what you have setup in /etc/security/limits.conf or in a different config file (remember supervisord) then you need to do some digging to see which configuration file is used.