Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Changing ulimit on "max user processes" 2

Status
Not open for further replies.

Xitron

MIS
Aug 12, 2002
32
0
0
US
Hi. Running AIX 433-10 (oslevel -r). I'm having an intermittent problem with Oracle, creating the error:

WARNING: ORA-12540: TNS:internal limit restriction exceeded

One of the web pages I found offered the following suggestion for an HP user:

"This error points to a resource limit in the HP kernel.
Try increasing the following kernel settings.
Max number of procs per user/system wide, maxuprc/nproc
Max number of open files per user/system wide, maxfiles/nfile
You can use "sysdef" to see the current settings."

With that in mind, I logged on as myself, to see where I stood on limitations:
$ ulimit -a
core file size (blocks) 1048575
data seg size (kbytes) 131072
file size (blocks) 1048575
max memory size (kbytes) 32768
open files 2000
pipe size (512 bytes) 64
stack size (kbytes) 32768
cpu time (seconds) unlimited
max user processes 128
virtual memory (kbytes) unlimited


The "max user processes" seemed kind of low at 128, especially since Oracle *may* be trying to run many more than that (I've no idea, I'm just guessing and trying what the gent above suggested), so I su'd to root (using 'su -' so I'd get the full login with environment), and ran 'ulimit -a' to see where root stood on limitations:
# ulimit -a
core file size (blocks) 1048575
data seg size (kbytes) 131072
file size (blocks) 1048575
max memory size (kbytes) 32768
open files 2000
pipe size (512 bytes) 64
stack size (kbytes) 32768
cpu time (seconds) unlimited
max user processes 262144
virtual memory (kbytes) unlimited


That looked like a much friendlier "max user processes" number, so I su'd to oracle (again using 'su - oracle' to process the full login and get oracle's environment), and ran 'ulimit -a' to see what oracle's limitations were:
$ ulimit -a
core file size (blocks) 1048575
data seg size (kbytes) 131072
file size (blocks) 1048575
max memory size (kbytes) 32768
open files 2000
pipe size (512 bytes) 64
stack size (kbytes) 32768
cpu time (seconds) unlimited
max user processes 128
virtual memory (kbytes) unlimited


So oracle has the same limitations that I have. I decided I'd like to bump up the "max user processes" by a considerable margin to see if it would help. Wanting to learn the AIX syntax for their 'ulimit' command, I went to:


It looked simple enough. Just run:
'ulimit -[letter_code_for_limit_you_want_changed] newlimit'

No worries. Easy. Now, what letter code is "max user processes" according to this man page? Hmmmmm... oh, that's right! There ISN'T one! >:-(

-a Lists all of the current resource limits.
-c The size of core dumps, in number of 512-byte blocks.
-d The size of the data area, in number of K bytes.
-f Sets the file size limit in blocks
-H Says that the hard limit for the given resource is set.
-m The size of physical memory, in number of K bytes.
-n Limit on number of file descriptors a process may have.
-s Specifies the stack size, in number of K bytes.
-S Says that the soft limit for the given resource is set.
-t The number of seconds to be used by each process.

So nothing about the "max user processes". The page *does* say that some limits are set by default in /etc/security/limits, so I went there to see what I could learn:
* Sizes are in multiples of 512 byte blocks, CPU time is
* in seconds
* fsize - soft file size in blocks
* core - soft core file size in blocks
* cpu - soft per process CPU time limit in seconds
* data - soft data segment size in blocks
* stack - soft stack segment size in blocks
* rss - soft real memory usage in blocks
* nofiles - soft file descriptor limit
* fsize_hard - hard file size in blocks
* core_hard - hard core file size in blocks
* cpu_hard - hard per process CPU time limit in seconds
* data_hard - hard data segment size in blocks
* stack_hard - hard stack segment size in blocks
* rss_hard - hard real memory usage in blocks
* nofiles_hard - hard file descriptor limit
*
* The following table contains the default hard values if
* the hard values are not explicitly defined:
*
* Attribute Value
* ========== ============
* fsize_hard set to fsize
* cpu_hard set to cpu
* core_hard -1
* data_hard -1
* stack_hard -1
* rss_hard -1
* nofiles_hard -1
*
* NOTE: A value of -1 implies "unlimited"
default:
fsize = 2097151
core = 2097151
cpu = -1
data = 262144
rss = 65536
stack = 65536
nofiles = 2000

Again, nada. It *does* say that "The following table contains the default hard values if the hard values are not explicitly defined:"... but defined WHERE?

Another quick search determines that this whole time I've *not* been running AIX's ulimit command, but rather have been running the 'bash' internal ulimit command. So now I run the AIX ulimit command for each user, and get the following output:

Myself:
$ /usr/bin/ulimit -a
time(seconds) unlimited
file(blocks) 2097151
data(kbytes) 131072
stack(kbytes) 32768
memory(kbytes) 32768
coredump(blocks) 2097151
nofiles(descriptors) 2000

root:
# /usr/bin/ulimit -a
time(seconds) unlimited
file(blocks) 2097151
data(kbytes) 131072
stack(kbytes) 32768
memory(kbytes) 32768
coredump(blocks) 2097151
nofiles(descriptors) 2000

oracle:
$ /usr/bin/ulimit -a
time(seconds) unlimited
file(blocks) 2097151
data(kbytes) 131072
stack(kbytes) 32768
memory(kbytes) 32768
coredump(blocks) 2097151
nofiles(descriptors) 2000


Well, that looks the same for all three users. And this just brings up another question: which 'ulimit' is operative here? Am I operating under the restrictions of the 'bash internal ulimit', or the 'AIX /usr/bin/ulimit'? Either way, I can't seem to change the bash setting for 'ulimit -u' (I get this error message: bash: ulimit: cannot modify limit: A system call received a parameter that is not valid.). And in the AIX ulimit, there "ain't no sech animal" :-(

Can anyone point me in the right direction? As you can tell by this novella, I'm more than willing to do the work and dig for my own answers. But a URL explaining 'bash internal ulimit' vs. 'AIX /usr/bin/ulimit', and how to make changes, especially to the 'max user processes' variable would be ever so handy.

Thank you!

Unca Xitron
 
max user processes is set smit/system environments/ change show characteristics of operating system, not ulimit.

You should get with your DBA to find out what an estimate of the number of processes oracle may run at one time. (there is a parm for the database for processes. the max user processes on the AIX system should be higher than that number.)

You do not have to boot the box when you change max user processes (unlike on an HP).

 
Normally there are three things we change for oracle. the system maxuproc and oracle's fsize and data segment size. These are the commands we use:
Code:
chdev -l sys0 -a maxuproc=512
chuser fsize=-1 data=-1 oracle
Hope that helps.
 
Thank you both so much! Excellent information!

Unca Xitron
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top