Operating System - Linux
1752794 Members
5957 Online
108789 Solutions
New Discussion юеВ

Re: /etc/security/limits.conf Limits - does it override uname profile settings?

 
SOLVED
Go to solution
Alzhy
Honored Contributor

/etc/security/limits.conf Limits - does it override uname profile settings?

If user has set uname limits in its profile - say ulimits for nofile @ 64k, and I have set limits.conf for such user to 256K - which one would prevail?

I thought the limits.conf file but I would like to confirm if this is true?

Hakuna Matata.
5 REPLIES 5
Matti_Kurkela
Honored Contributor
Solution

Re: /etc/security/limits.conf Limits - does it override uname profile settings?

A regular user can adjust his/her soft ulimits freely between 0 and the hard limit value.

A regular user can _decrease_ his/her hard ulimits, but cannot increase them.

In your example, when the user's session is initiated, PAM sets the limit to 256k. When the .profile script begins executing, it further reduces the limit to 64k.

If the .profile changes the soft limit only, the user can later increase the limit back to whatever is the hard limit value. But if the .profile changes the hard limit, the only way the user can restore the 256k limit value is to edit his/her .profile to remove the ulimit command, then logout and login again.

MK
MK
Alzhy
Honored Contributor

Re: /etc/security/limits.conf Limits - does it override uname profile settings?

Thanks Matti.

If user has "ulimit -n 65535" in its profile -- is it soft or hard limit that is being set?

Hakuna Matata.
Matti_Kurkela
Honored Contributor

Re: /etc/security/limits.conf Limits - does it override uname profile settings?

Unless you're using the "-H" option with ulimit, you're dealing with soft limits only.

MK
MK
Alzhy
Honored Contributor

Re: /etc/security/limits.conf Limits - does it override uname profile settings?

Thanks again Matti...

In your experience, in an Oracle environment (11G).. would a lack in filehandles to oracle result in a hang and would the OS/Oracle be screaming all over for such a lack?

We've a lingering issue wherein a very stable 10G environment ot upgraded to 11G. Our DBAs had .profile settings for ulimits to nofile set to 64K. Ever since -- it's been hanging. SAR logs (5 minute intervals) do not show us exceeding 64K file handles but we're very close -- shy of 1000 file handles. After the hang (a forced rset)... Oracle logs do not even show if that limit was reached... In your experience -- would this lack of file handles to oracle result in such a scenario?

We've since increased limits.conf for oracle and removed ulimit declarations in /etc/profile and restarted the DB... we're running 12 hours with no issues yet. I've also started closer inetrval sar stats to capture file handle usage.


Thanks.
Hakuna Matata.
Matti_Kurkela
Honored Contributor

Re: /etc/security/limits.conf Limits - does it override uname profile settings?

I see you already got some comments to the Oracle issue in your other threads.

Remember that network sockets may count towards the file descriptor limit too.

MK
MK