Operating System - HP-UX
1832994 Members
2200 Online
110048 Solutions
New Discussion

nbuf and bufpage settings

 
steven Burgess_2
Honored Contributor

nbuf and bufpage settings

Hi All

Quick question. I have seen this before after users were experiencing issues but never found out why

nbuf = 0
bufpages = 1992

dbc_min_pct = 2
dbc_max_pct = 2

The general theory is that by setting nbuf and bufpages to 0 you then control the min and max of buffer cache by the dbc values, for eg 2 and 10.

Why would you set it as above ?
What implications does this have ?

Regards

Steve
take your time and think things through
8 REPLIES 8
James Murtagh
Honored Contributor

Re: nbuf and bufpage settings

Hi Steve,

Not sure if this is a general question or particular to the sizes you have mentioned, so will answer both.

In this case the buffer cache would be allocated 1992 4k pages and nbuf would be scaled to 1992/2 headers. You will see a message in the message buffer confirming this on boot. This of course would be an extremely small buffer cache, even if the the only filesystems were for the core OS. You would see delays in this case as buffers would be continually flushed and re-used.

Why would you have a fixed buffer cache? On small memory systems or systems where you wanted to keep a tight reign on the memory allocated to it. Perhaps performance tests indicated a particular size of cache yielded the best performance, perhaps on systems with mainly raw partitions. I have also seen occasions in the past where certain filesystem routines didn't allocate dynamic buffers correctly so a fixed buffer cache was a temporary solution until it was patched.

Regards,

James.
U.SivaKumar_2
Honored Contributor

Re: nbuf and bufpage settings

Hi,

If nbuf is 0 , then the buffer space is derived from bufpages parameter. If bufpages is greater than zero , dbc_min_pct and dbc_mac_pct parameters are ignored.

So your server uses bufpages only.

regards,

U.SivaKumar



Innovations are made when conventions are broken
steven Burgess_2
Honored Contributor

Re: nbuf and bufpage settings

Hi James

I didn't make that to clear did I

Thanks for the reply.

Yes I understand why you would fix the buffer cache. I couldn't understand why you would go halfway

ie

nbuf=0
bufpages = 1992

then setting dbc min and max to 2

With the above does dbc min and max come into play at some point ? I though you had to set them both nbuf and bufpages before dbc takes affect ?

Steve
take your time and think things through
steven Burgess_2
Honored Contributor

Re: nbuf and bufpage settings

U.SivaKumar

That makes things clearer

This particular server has very little memory and runs ingres db

Thanks

Steve
take your time and think things through
T G Manikandan
Honored Contributor

Re: nbuf and bufpage settings

Steve,

Yes,

Only when the bufpages and nbuf are zero the dynamic buffer cache gets enabled i.e parameters dbc_max_pct and min_pct.

Always the bufpages takes precedence.

In your case there is no effect on the setting of the dynamic buffer cache.
It simply stays with the values in the kernel.

Just look at the Quote from the kernel parameter page

/*
bufpages = 0, nbuf = 0: Enables dynamic buffer cache.

bufpages not zero, nbuf = zero: Creates bufpages/2 buffer headers and allocates (bufpages times 4 Kbytes) of buffer pool space at system boot time.

bufpages = 0, nbuf not zero: Allocates nbuf*2 pages of buffer pool space and creates nbuf headers at boot time.

bufpages not 0, nbuf not zero: Allocates bufpages pages of buffer pool space and creates nbuf buffer headers at boot time. If the two values conflict such that it is impossible to configure a system using both of them, bufpages takes precedence

*/

THanks
U.SivaKumar_2
Honored Contributor

Re: nbuf and bufpage settings

Hi,

dbc_max_pct and dbc_min_pct will be ignored ad bufpages paramter set greater than zero.

regards,

U.SivaKumar
Innovations are made when conventions are broken
James Murtagh
Honored Contributor

Re: nbuf and bufpage settings

Hi Steve,

No probs.

As long as either nbuf of bufpages are non-zero, the dynamic buffer cache is not used. The "man 5 bufpages" reference describes all the formulations well. This may also answer one part of the question - there is a formula depending if nbuf is set, bufpages is set, both or neither, so it may well be the sys admin who did it knew this or was just lazy! :-)

It looks to me like the dbc values were set that way trying to replicate a fixed cache. I'd imagine they then realised you could set this with bufpages.

Oh, another reason for this small buffer cache may be all the filesystem data is critical so is written synchronously to disk, so you wouldn't need a buffer cache as such. Sometimes banks and other such companies do this.

Regards,

James.

steven Burgess_2
Honored Contributor

Re: nbuf and bufpage settings

Hi

Reading

http://www.docs.hp.com/hpux/onlinedocs/939/KCParms/KCparam.BufPages.html

Thanks for the replies

Steve
take your time and think things through