limits.conf nproc setting for oracle user not effective

Latest response

At the moment the oracle user's nproc on one of our servers is:

[oracle@xxxx003cnc ~]$ ulimit -u
16384

According to KB with

[root@xxxx003cnc ~]# sysctl -a | grep threads-max
kernel.threads-max = 256694

so we should be able to get upto 128347 for an nproc value for any user. If I create a new user account from scratch it gets this value when you run ulimit -u.

However if we try to set it for the oracle user in limits.conf its not honored. It is always 16384 no mater what we set there. I can decrease it from the cmd line (ulimit -u 1000 will set it to 1000) but can't increase it to 128347.

current contents of the limits.conf file are:

#* soft core 0
#* hard rss 10000
#@student hard nproc 20
#@faculty soft nproc 20
#@faculty hard nproc 50
#ftp hard nproc 0
#@student - maxlogins 4

#oracle soft nproc 2047
#oracle hard nproc 16384
oracle soft nofile 65536
oracle hard nofile 65536

# End of file
# Disable core dumps
* soft core 0
* hard core 0

Have tried adding directives to set nproc to 128347 but it doesn't work even after a reboot. We're running RHEL5.9.2 . Is it possible that the # is being ignored and still in effect even if the line for oracle's nproc setting is commented out?

Responses

Have you tried checcking /proc/sys/fs/file-max and making sure you're not exceeding that?

Our oracle tuning with limits.conf:

End of file

oracle soft nofile 1024
oracle hard nofile 65536
oracle soft nproc 2047
oracle hard nproc 16384
oracle hard stack 10240
oracle hard memlock 8246272
oracle soft memlock 8246272

It's probably given a 10% boost for performance from the default limits.

PREFACE: and this is important, as I don't want to send you on a wild goose chase... we ran into a similar issue, but it seems rather specific. We were running RAC on RHEL 5. I don't know if there was something particular about OHASD, or if any Oracle startup would be effected.

Issue: If OHASD was started any other way than using an entry in inittab, the values in /etc/security/limits.conf were not respected.

So - I would ask:
Are you running RAC?
What method do you use to startup the DB? (inittab vs init script)
Are you running sudo as oracle to root to run the scripts?
Do you have the ability to run the script as root?

I wonder if there is not a PAM setting that would be impacting this in your case. I'll do some digging.

UPDATE: My digging produced the following

Shell Limit

Item in limits.conf

Hard Limit
Maximum number of open file descriptors
nofile 65536

Maximum number of processes available to a single user
nproc 16384

To increase the shell limits:

Add the following lines to the /etc/security/limits.conf file:

oracle              soft    nproc   2047
oracle              hard    nproc   16384
oracle              soft    nofile  1024
oracle              hard    nofile  65536

Add or edit the following line in the /etc/pam.d/login file, if it does not already exist:

session    required     pam_limits.so

Depending on the oracle user's default shell, make the following changes to the default shell start-up file:

· For the Bourne, Bash, or Korn shell, add the following lines to the /etc/profile file (or the file on SUSE Linux Enterprise Server systems /etc/profile.local):

if [ $USER = "oracle" ]; then

        if [ $SHELL = "/bin/ksh" ]; then

              ulimit -p 16384

              ulimit -n 65536

        else

              ulimit -u 16384 -n 65536

        fi

fi

What James said as far as pam stuff, the following should be in your /etc/pam.d/system-auth by default:

session required pam_limits.so

If it's not, you may be running in to that.

then for RHEL6 you can check in /etc/security/limits.d/

Please help in this regards