Problem : setting ulimit, limits.conf

Problem : setting ulimit, limits.conf

Could anybody explain to me the below settings:

echo 10240 > /proc/sys/fs/file-max

/etc/security/limits.conf

*       soft    nofile  10240
*       hard    nofile  10240

Should the hard limit be more than the soft limit? What is the difference between the above 2 settings since it’s setting for maximum file descriptors?


Solution: setting ulimit, limits.conf

> /etc/security/limits.conf
contains the settings used while booting the system, probably some other applications use it too

> /proc/sys/fs/file-max
contains the current kernel settings, this corresponds to the hard limit, you may change is at runtime
echo 1022 > /proc/sys/fs/file-max
only root can, for obvious reason 😉