Operating System - HP-UX
1845992 Members
3667 Online
110251 Solutions
New Discussion

Kernal Params .. Hard number or Forumula ??

 
someone_4
Honored Contributor

Kernal Params .. Hard number or Forumula ??

As many of you guys know I have been working ok kernal tunning for about a week now. From some people I hear that a foumula is better then a hard number and also vise versa. I would like to start a little talk here about what is better and why?

Why am I asking this well here is a nice story I would like to share.Here is the link from yesterday as to what started this:
http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x30d9cf38d6bdd5118ff10090279cd0f9,00.html

Well today I was planning on working with another server this time a cnr/dhcp server that we have been having performance issues.It would core dump and so all sorts of weird things. sar -v 10 would tell me that
file-sz was reaching its limit within 10.
The kernal params were all set to default. So I knew there was an issue in the making.We I was trying to install Glance .. And I was having all sorts of issues with swinstall. While I was doing this the cnr app took a big dump! It was bad we couldnt even restart it.. and file-sz was at its limit and this is a production box. Well I called for an emergency kernal config. I tried to modify the kernal and up maxusers to 256. But nothing would work .. sam , maunual , or kmtune!I opened up a call with HP and were were looking. Well I thought about it and file-sz was at the limit and maybe that is why I wouldnt do anything with the kernal. So I founnd another app .. and I stopped it and then file-sz went way down. Then I was able to configure my kernal and now everything is working great on this server. All I did was up maxusers to 256 did I jump the gun on this? Everything works fine now .. But they way I see it now is kernal tunning is an art. Every server is differnt depending on the app. Now I am asking the "artist" on our forum to share their thoguhts... Hard number or forumla and why..

Richard =)

13 REPLIES 13
Stefan Farrelly
Honored Contributor

Re: Kernal Params .. Hard number or Forumula ??

I prefer to hard set them all myself. Why ? I remember in the past having cases where almost all the configurable parameters were formulae, and thus is was sometimes very difficult to work out what all the actual values were, and on occasion someone would change just 1 single formula - and low and behold tons of other parameters are affected and adjusted unnecessarily on excessively. Suddenly the amount of RAM the OS is using jumps by tens of MB when you only really needed to increase a single parameter at a few MB increase. Doesnt make so much difference nowadays with modern servers having tons of RAM, but years ago it did make a difference!

Now with a single glance at the system file I can see exactly why all the values are. Simple = easy for me.
Im from Palmerston North, New Zealand, but somehow ended up in London...
Sachin Patel
Honored Contributor

Re: Kernal Params .. Hard number or Forumula ??

Hi Richard,

I think it depends. In my view formula is better because expert has already work many hours and had set that formula. But here at my work some senior Admin. just used hard number stright because they knows that this number is the output when they change one or more other parameter's value. I don't do that way I go look for every parms. and changes accordingly so I do not have to use hard number..
But then it tooks me more time then others..

Sachin
Is photography a hobby or another way to spend $
Rita C Workman
Honored Contributor

Re: Kernal Params .. Hard number or Forumula ??

An art...a science...good adjectives.
Since no two boxes are the same. It is difficult to to give 1-2-3 answers. As a 'general' rule leaving those parms that are set to calc based on a formula is best to leave it that way. Since certain parms work in harmony with certain other parms and so as one increases you definitely want the others to increase.
Now is it wrong to change this to a flat value...NO it is not wrong to do this. But if you change from a calc to a flat value, you had best know what your doing and remember that you will continue this way until you restore the calc. So you better remember for the next time you change a parm. But not only you, anyone who comes after you would need to know this.

And since fixing your kernel is a matter of tuning, then fine tuning, then re-tuning be cause of changes and new apps, I am also including this thread that gives you the parms and info on each. I have kept this bookmarked and use it as a reference whenever I need to adjust my parms. I hope you find as helpful.

Regards,
Rita

http://docs.hp.com//hpux/onlinedocs/os/KCparams.OverviewAll.htm
harry d brown jr
Honored Contributor

Re: Kernal Params .. Hard number or Forumula ??

Sometimes I over-ride formulas with "hard coded" parameters, and sometimes I don't. So I guess it depends on the situation.

It's important to understand the formula relationships, especially the slightly ignorant semaphore ones, where you have to make a change to one, build a new kernel, then reboot, before you can change any of the others. This is because of the interdependencies of the kernel parameters.

Unfortunately there is no silver bullet.

harry

live free or die
Live Free or Die
A. Clay Stephenson
Acclaimed Contributor

Re: Kernal Params .. Hard number or Forumula ??

Hi Richard:

The correct answer to this question is it depends. Some of the choices made by the 'expert' designers leave me baffled. e.g. dbc_max_pct 50 ?? or the Tuned Parameter Set for Databases that set maxslice to 1. Most of the formulae are reasonable but I tend to plug the values directly. I don't like changing one value and having it affect many others; however, before I would suggest than an admin abandon the formulae, my rule of thumb would be - if you know what other values are affected by the change in this parameter then you don't need the formulae. When you know what each parameter does without having to look it up, you are probably ready to do away with the formulae. In general, the formulae are reasonable for the 'typical' system. They tend to keep you from making terrible decisions but at the same time prevent you from making optimal decisions.

Your problem yesterday was quite typical. Nfile seemed to be too low. Was it or was the real problem that multiple instances of the same program were eating file desriptors? Sometimes the correct answer is not to tune at all.

I heard a very interesting talk this year at HpWorld which might render all this moot. Since the kernel already knows that it is approaching a limit/fence/resource constraint, why can't it take the action and dynamically tune the kernel on 'on the fly'? Actual work is being done in this area and the dynamically tunable parameters in 11.1x are a first step.
Of course, yesterday's nfile problem throws a wrinkle there too. If the kernel did bump nfile up, would that have been the correct action or would the correct action have been kill the processes that were eating the file descriptors.

Regards, Clay
If it ain't broke, I can fix that.
James R. Ferguson
Acclaimed Contributor

Re: Kernal Params .. Hard number or Forumula ??

Hi Richard:

Both sides of this question have merit. As you are already aware, I lean toward the use of the formula. As Stefan, Harry and Clay noted, in different ways, it's important to know the interrelations among the parameters.
To this end, one thing you can do is make the calculation(s) on paper and see if changing something like 'maxusers' for the purpose of inflating 'nproc' would grossly over-inflate 'nfile' (or 'ncallout' or 'ninode') on *your* server.

Another rule-of-thumb I learned a long time ago, was that starting with default values isn't all bad; certainly until you learn the ramifications of not using them and/or empirically show that something else is better.

As Clay is fond of saying "food for thought".

Regards!

...JRF...
Sridhar Bhaskarla
Honored Contributor

Re: Kernal Params .. Hard number or Forumula ??

Richard,

My response is the same as I mentioned in the thread you mentioned.

But it depends again. Most of the time, we may not want to change the variables. Let's take the same example. You wanted to increase 'nproc' parameter.

nproc=20 + (8 * MAXUSERS)

You can either change "8" or MAXUSERS. If you change MAXUSERS, it is going to change other kernel parameters like nfile, ninode and nclist that may not be necessary. Having unnecessary high values may impede the performance. Particularly ninode that is purely hfs related and we want to keep it as low as possible.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Michael Tully
Honored Contributor

Re: Kernal Params .. Hard number or Forumula ??

Hi Richard,

As most of the other guys have said "it depends" and it does... in my opinion if a system is set up for one particular purpose. We have several systems that run PeopleSoft with Informix (ugggH!)so we have set these machines accordingly and other boxes which don't run databases like webservers and mailboxes, where we have used formulas.

My 2 cents worth
-Michael
Anyone for a Mutiny ?
linuxfan
Honored Contributor

Re: Kernal Params .. Hard number or Forumula ??

Hi Richard,

Just wanted to share my thoughts. As always there are two sides of a coin and i am of the opinion to hard set my kernel parameters. I Normallyi have tuned kernel parameter set and i apply them.

If there is a problem i change the value (ofcourse one has to understand what that kernel parameter does and the consequences of changing the values).

It would be interesting if Anyone can tell us how the formulae for these parameters were derived(history of these parameters). Maybe these work for most of the situations, but it would be interesting to know if HP is revisiting these formulae for newer OS'es.

Like others have said, Most of the time the formulae works but there are situations where you want to use hardset values because you don't want to impact too many other parameters. but then its a choice one has and it depends on the situation.

Don't you hate those "It Depends" Q&A.

-Well i guess the answer is "it depends" ;)

-Regards
Ramesh
They think they know but don't. At least I know I don't know - Socrates
A. Clay Stephenson
Acclaimed Contributor

Re: Kernal Params .. Hard number or Forumula ??

Hi again Richard:

I have one more thought that I should have completed earlier. The terrible decisions that you could make by hard setting some of the values are MUCH worse than having the non-optimal values.

I think I'll answer this question by answering a totally different one. Most novice admins constantly and continually login as root (they tend to like the 'power' and convenience) but most experienced admins ordinarily login as a regular user and only become super-user when needed. They hate to be their own worst enemy.

Abandoning the formulae is much like that. It's fine (and even encouraged) when you know what you are doing and what the effects and interactions will be but if you don't ....

Food for thought, Clay
If it ain't broke, I can fix that.
Doug Grumann
Respected Contributor

Re: Kernal Params .. Hard number or Forumula ??


Some of you may find the following interesting:
http://h21007.www2.hp.com/dspp/ddl/ddl_Download_File_TRX/1,1249,280,00.pdf
"It Depends"
Mladen Despic
Honored Contributor

Re: Kernal Params .. Hard number or Forumula ??

Richard,

I'd like to expand on your question with a few thoughts:

Why were some kernel parameters defined via formulas in the first place?

If the default values were hard set at the time of the install, what would the implications be?

How many sysadmins out there would actually prefer hard set values?

I prefer the formulas as they give me some comfort that my system will remain stable for some time after I have modified a single kernel parameter. This may not ALWAYS be true of course, but it works ... well, almost always. The key advantage here, I'd say, is the simplicity.

The formulas will likely leave my kernel parameters not optimized, but unless I have the time and expertise, it is probably not worth considering.

But if I had time and if I really wanted to understand this well, I would not be afraid to experiment with different formulas and some hard set values.

Regards ... Mladen






Wodisch
Honored Contributor

Re: Kernal Params .. Hard number or Forumula ??

Hello,

very good thread, indeed!

Just do say/write something different from the rest, here is my opion:

I go for *hard* values all the time!

But I do have to tell you why (read this "cum grano sale" as my latin teacher used to say :-) I do it this way:

- The formulas are plain wrong (for me, I told you): they were written for UN*X-users connected through serial MUXes, working on VT100/HP type ASCII-terminals at 9600 baud (that is VERY slow, seen from today's perspective) running a single shell and ONE other program (the "application"). This is what "maxusers" is referring to... Do you have users of that type? No - then why using "maxusers"???

- I do know the kernel intimate enough to write (and have written) device drivers (one even in PA-RISC assembler), hence I do have some understanding of what's going on *down* there (NOT as much as the immortal Bill Hassell, of course). So for many (NOT all) parameters do I do know well enough how they are used, internally.

- I am used to do a lot of performance analysis and the tuning, and I do have about some 15plus years of experience in that area (hey, the first HP-UX machine I was working at, did have a MC68010 CPU - anybody remembers that beast?).

- To sum it up: I do take responsibility for what I do (knocking on wood, here :-) and how I do it and this is working for me (and my customers, of course) fro some years now.

Quite often someone will just not be able to do it that way (BTW: my heart does beat faster when I am about to do some tuning to a mission critical production machine - I am no cold-blooded fish - and I do a hell of a lot of testing before), for lack of experience, lack of "braveness" (always good to lack this in sysadmin-ing :-) and such.
So, yes, I do go for *hard* parameters, but I will NOT recommend it to others! Not liking the "maxusers" approach personally, does not mean its a bad one, or useless, or such! Its a kind of a matter of taste (do you like vanilla icecream - I do NOT).
And since I never met two stations alike (not even in MC/SG clusters, where they *should* be close), I am still not going to create my own *template* for kernels. But I do have some, say, "sets of experience" for certain applications...

So, getting back to the start: the "forums" seem to be exactly the right place to ask for other admin's experience on kernel parameters - you just have to support enough information about what you have and what you want/need.

Just my $1.00,
Wodisch (who usuall writes shorter replies)