1752364 Members
5721 Online
108787 Solutions
New Discussion юеВ

Re: Config file syntax.

 
SOLVED
Go to solution
Stephen Day
Occasional Advisor

Config file syntax.


I have a number of machines with ram from 256Meg to around 6 gig.

I want to setup my ignite config such that on machines with memory over 1gig it will set dbc_max_pct to correspond to 300 Meg of RAM.

I want dbc_min_pct set to 5 or dbc_max_pct if that is lower.

I have written a config that I think should do this, instl_adm says the syntax is fine, but it sets max_dbc_pct to very high values. My config is below.

I'm using ignite B.3.6.82 on HP-UX 11.11

My config:

( memory > 1000MB )
{
_membytes = ${memory+0}
_dbc_max = ( 100 * ( 300MB / _membytes ))
mod_kernel += "dbc_max_pct " + ${"%d" _dbc_max}
( _dbc_max < 5 )
{
mod_kernel += "dbc_min_pct " + ${"%d" _dbc_max}
}
( _dbc_max >= 5 )
{
mod_kernel += "dbc_min_pct 5"
}
}
( memory <= 1000MB )
{
mod_kernel += "dbc_max_pct 30"
mod_kernel += "dbc_min_pct 5"
It was like that when I got here.
9 REPLIES 9
Fragon
Trusted Contributor

Re: Config file syntax.

Hi Stephen,
Please make sure that if you want to make dbc_max_pct or dbc_min_pct available(dynamic buffer cache), you should set bufpages & nbuf to 0.
My idea, if the physical memory over 1G, you can directly set bufpages to 300M. Else, set bufpages & nbuf to 0 and dbc_max_pct to 30!

Help this can be helpful!

-ux
Stephen Day
Occasional Advisor

Re: Config file syntax.

nbuf and buffpages are set to 0 further up the same config file.

If I check on a newly ignited machine they are indeed both set to 0.

I want a dynamic buffer cache that is no bigger than 300Meg. Some database machines don't use files much so I don't really want a static 300Meg buffer cache.
It was like that when I got here.
RolandH
Honored Contributor

Re: Config file syntax.

I think you have only some typo errors that will not recognized by the syntax check.
Try this.

( MEMORY > 1000MB )
{
_memytes = MEMORY
_dbc_max = ( 100 * ( 300 / _membytes ))
mod_kernel += "dbc_max_pct" + ${"%d" _dbc_max}

( _dbc_max < 5 )
{
mod_kernel += "dbc_min_pct " + ${"%d" _dbc_max}
}
( _dbc_max >= 5 )
{
mod_kernel += "dbc_min_pct 5"
}
}
( MEMORY <= 1000MB )
{
mod_kernel += "dbc_max_pct 30"
mod_kernel += "dbc_min_pct 5"
}


I think that will work !!!


Roland













Sometimes you lose and sometimes the others win
RolandH
Honored Contributor

Re: Config file syntax.

And I have a typo in my suggestion, sorry

_membytes = MEMORY

not

_memytes = MEMORY


Roland

Sometimes you lose and sometimes the others win
Stephen Day
Occasional Advisor

Re: Config file syntax.

Thanks Roland, I'll give that a go.

The point of _membytes = ${memory+0} was to make sure ignite treats _membytes as an int containing the number of bytes, not however else it may
internally store values in megabytes.

Maybe this isn't needed.


The following should divide the number of bytes I'm aiming for by the number of bytes of ram.
Above:
_dbc_max = ( 100 * ( 300 / _membytes ))

Shouldn't this be:
_dbc_max = ( 100 * ( (300*1024*1024) / _membytes ))
?

It was like that when I got here.
RolandH
Honored Contributor
Solution

Re: Config file syntax.

I have checked with my ignite MEMORY will be internaly used as kb.
So we must use this line

_dbc_max = ( 100 * ( (300*1024) / _membytes ))

check it by yourself

set
_membytes = MEMORY

to
init _membytes = MEMORY

than open a new installation window for a system and open the Additional Button. You will see that _membytes is in kb.


Roland
Sometimes you lose and sometimes the others win
RolandH
Honored Contributor

Re: Config file syntax.

Hi Stephen,

I'm not sure that 10 points was to fast.
I'm using the same ignite version on 11.11 as you . But if I open the additonal window the variable _dbc_max is always the value 0.
Has you the same effect?

If I use this (Box with 2GB RAM)

_dbc_max = ( 100 * ( 300 * 1024 / _membytes ))

it is 0

and if I use this

_dbc_max = ( 100 * 300 * 1024 / 2097152 )

the correct value of 14 is calculated.

HHMMMMMM ?????


Roland



Sometimes you lose and sometimes the others win
Stephen Day
Occasional Advisor

Re: Config file syntax.

Cracked it!

The following config works like a charm:

---
( MEMORY > 1000MB )
{
init _dbc_max_target = 300MB
#Add one due to the following being rounded down.
init _dbc_max = 1+( ( _dbc_max_target ) / ( MEMORY / 100 ) )
mod_kernel += "dbc_max_pct" + ${"%d" _dbc_max}

( _dbc_max < 5 )
{
mod_kernel += "dbc_min_pct " + ${"%d" _dbc_max}
}

( _dbc_max >= 5 )
{
mod_kernel += "dbc_min_pct 5"
}

}

( MEMORY <= 1000MB )
{
mod_kernel += "dbc_max_pct 30"
mod_kernel += "dbc_min_pct 5"
}
---

The problems I'd seen were due to three things:
Ignite changing varibles from KB to Bytes,
Interger math losing everything after the decimal point,
and numbers overflowing a 32 bit integer.

What was causing me the most confusion was the background conversion between KBytes and Bytes on any minus or plus operation.

eg. on a machine with half a gig of RAM:
MEMORY = 524288
but
MEMORY+0 = 536870912


HP - If you are reading this:

Please use 64 bit integers on a 64 bit machine running a 64 bit OS.
Please let me set the type of vars. Double and unsigned Long Int would be nice.

Otherwise, thanks for a great product.

It was like that when I got here.
Stephen Day
Occasional Advisor

Re: Config file syntax.


I have another problem.
The above works fine, however intsl_adm gives me a divide by zero error in
the following line:

init _dbc_max = 1+( ( _dbc_max_target ) / ( MEMORY / 100 ) )

MEMORY / 100 clearly isn't zero so anyone know whats going on??
It was like that when I got here.