Operating System - HP-UX
1833756 Members
2487 Online
110063 Solutions
New Discussion

kernel parameter effective_maxpid

 
Simone Teles da Hora_5
Occasional Advisor

kernel parameter effective_maxpid

Hi,

How can i limit PID number? I have a rp3440 + 11i (HP-UX 11.11)? There is a define MAXPID on /usr/include/sys/param.h which limit Maximmum PID in 8 millions, but there is another kernel parameter which does it too!!
How can it works?

** HP-UX 11.00 this limit is 30.000!!

thanks

STH
7 REPLIES 7
Steven E. Protter
Exalted Contributor

Re: kernel parameter effective_maxpid

Use kmtune to limit the number. Its a formula by default in the OS install, but you can change it.

kmtune -s effective_maxpid=

Process for manually building and installing a kernel:
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=105739

sam kernel, configurable parameters will also do this btw.

Frankly I am wondering about that header file.

Maybe you should change it.



SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Simone Teles da Hora_5
Occasional Advisor

Re: kernel parameter effective_maxpid

Steven,

I´m not complete sure, but I see process with PID great than 30.000, and my kernel parameter configurated as 30.000, look at this:

[root@fenix shora]# kmtune -q effective_maxpid
Parameter Current Dyn Planned Module Version
===============================================================================
effective_maxpid - - ((NPROC<=30000)?30000:(NPROC*5/4))

How can it be possible?

thanks

ST
A. Clay Stephenson
Acclaimed Contributor

Re: kernel parameter effective_maxpid

First, never change a value in a sys/ header file unless you really know what you are doing. That is an excellent way to create an unbootable or unstable machine.

What is the value of nproc?

Consider the case of a machine that had a very large nproc. 30000 could be less than nproc so that no pid's might be available.

If you don't fall into this category, simply replace the formula with a hard-coded value of 30000 and build a new kernel.
If it ain't broke, I can fix that.
Simone Teles da Hora_5
Occasional Advisor

Re: kernel parameter effective_maxpid

Clay,

nproc = 2.500 and effective_maxpid = 30.000.

But i can see process with PID great than 30.000. how can it be possible?

[]´s

S
A. Clay Stephenson
Acclaimed Contributor

Re: kernel parameter effective_maxpid

Okay, it's time to ask the kernel itself what the tunable is set to:

echo "effective_maxpid/D" | adb /stand/vmunix /dev/kmem
If it ain't broke, I can fix that.
Kent Ostby
Honored Contributor

Re: kernel parameter effective_maxpid

Simone --

This formula:

((NPROC<=30000)?30000:(NPROC*5/4))

means that if the NPROC is <= 30000 then make it 30000.

If we fail the test of (NPROC<=30000), i.e. NPROC is > 30000, then the value is set to NPROC * 1.25.

So you would have to change the formula or assign a value to effective_maxpid.

This doesnt mean that its a good idea to do so.

Best regards,

Oz
"Well, actually, she is a rocket scientist" -- Steve Martin in "Roxanne"
Simone Teles da Hora_5
Occasional Advisor

Re: kernel parameter effective_maxpid

echo "effective_maxpid/D" | adb /stand/vmunix /dev/kmem
effective_maxpid:
effective_maxpid: 30000