dbTalk Databases Forums  

lock_limit

comp.databases.ingres comp.databases.ingres


Discuss lock_limit in the comp.databases.ingres forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Franky Leeuwerck
 
Posts: n/a

Default lock_limit - 01-21-2004 , 03:47 AM






Dear,

Defining a high value for the lock_limit results in lots of memory
alloction for the locking system.

How can one determine how high this lock_limit parameter must be set ?

Thanks in advance,

Franky

Reply With Quote
  #2  
Old   
Karl & Betty Schendel
 
Posts: n/a

Default Re: lock_limit - 01-21-2004 , 04:22 AM






At 1:47 AM -0800 1/21/04, Franky Leeuwerck wrote:
Quote:
Dear,

Defining a high value for the lock_limit results in lots of memory
alloction for the locking system.

How can one determine how high this lock_limit parameter must be set ?


My usual advice is to run the installation for a while and do a
lockstat -statistics.
Look at the LKB and RSB highwater numbers. These are how many locks and
resources your installation has used. Typically the numbers are much
smaller than you expect. I multiply by a nice safety factor, like 5 or 10,
and that's what I set lock_limit to.

Karl


Reply With Quote
  #3  
Old   
Roy Hann
 
Posts: n/a

Default Re: lock_limit - 01-21-2004 , 06:00 AM



"Karl & Betty Schendel" <schendel (AT) kbcomputer (DOT) com> wrote

Quote:
At 1:47 AM -0800 1/21/04, Franky Leeuwerck wrote:

Defining a high value for the lock_limit results in lots of memory
alloction for the locking system.
That's putting it mildly! I've looked at a number of systems that had over
a gigabyte of non-swappable shared memory dedicated to locking, when they
really only needed c. 25,000 locks (about 15Mb worth) for comfort.

Quote:
How can one determine how high this lock_limit parameter must be set ?

My usual advice is to run the installation for a while and do a
lockstat -statistics.
Look at the LKB and RSB highwater numbers. These are how many locks and
resources your installation has used. Typically the numbers are much
smaller than you expect. I multiply by a nice safety factor, like 5 or
10,
and that's what I set lock_limit to.
I'd agree with that completely, but I will add the caution that there is a
bug in early versions of Ingres II 2.6 in which lockstat (and indeed IMA)
return a very low value for LKB highwater. You can tell if you are affected
by looking at the current value of "Locks in use". If it is higher than the
highwater mark, you've pretty obviously got the problem. In that case I'd
probably just make an informed guess where to set lock_limit. (If the
system is nicely busy, maybe multiply locks in use by, say, three or four,
and then multiply that by the factors Karl suggests.)

Roy Hann (rhann at rationalcommerce dot com)
Rational Commerce Ltd.
www.rationalcommerce.com
"Ingres development, tuning, and training experts"




Reply With Quote
  #4  
Old   
Martin Bowes
 
Posts: n/a

Default Re: lock_limit - 01-21-2004 , 04:27 PM



Hi Franky,

Quote:
Dear,

Defining a high value for the lock_limit results in lots of memory
alloction for the locking system.
Damn Right! I found that each 200000 on the lock_limit requires an extra
112M of virtual memory per server to manage.

Quote:
How can one determine how high this lock_limit parameter must be set ?
My rule of thumb is:
10% Sum over all servers (active_limit) * number of locks per
transaction.

Eg. 3 servers with an active_limit of 150 and
2 servers with an active_limit of 50.
Furthermore, we allow 2000 locks per transaction.

Ergo we would set lock_limit to:
lock_limit = 0.1 * ((3 * 150 + 2 * 50)) * 2000
= 110,000.


The original default setting was 1053132.

Marty

PS. Don't use your thumb as a rule. The lines are all wonky and you might
hit it with a hammer.

Quote:
Thanks in advance,

Franky


--
Random Farscape Quote #4:
Jools - Play nice you monochromatic bitch!


Reply With Quote
  #5  
Old   
Franky Leeuwerck
 
Posts: n/a

Default Re: lock_limit - 01-22-2004 , 04:14 AM



I have currently configured 4 iidbms servers in the same installation,
each with 100 as the active_limit. The system has been configured for
100000 locks (107MB) and 4000 locks per transaction.

Both calculation ways, proposed by Karl and Martin, are indicating in
the same magnitude, which makes me more confident about the current
configuration.

Regards and thanks all for your quick replies.


Franky

Reply With Quote
  #6  
Old   
Martin Bowes
 
Posts: n/a

Default Re: lock_limit - 01-22-2004 , 04:09 PM



Hi Franky,
Quote:
Hello Martin,

Thanks for your quick reply.
Currently we have this configuration :
- 4 iidbms servers
- each with active_limit : 100
- max locks per transaction : 4000

According to your calculation :
(4*100)*4000*0,1
we come to a lock_limit of 160000

This comes closely to our current limit of 100000 locks ( about 107 MB in
memory ).

Your calculation makes me already confident that we have made a good guess
about this figure.

I am curious about your '10%'. I can easily understand why 10%, it makes
sense, but maybe you have specific (mathematical) grounds for that figure.
Like all good rules of thumb its based on a number I first thought of.
There is nothing too scientific about it.

The justification would be that in each server I just cant see all the
active connections configured actually being used and holding substantial
quantities of locks all the time.

10% is probably an overestimate. But I'd rather be way over than one
under.

Marty
Quote:
Regards,

Franky





-----Original Message-----
From: Martin Bowes [mailto:bowes (AT) bucket (DOT) its.unimelb.edu.au]
Sent: woensdag 21 januari 2004 23:09
To: Franky Leeuwerck
Cc: ingres newsgroup
Subject: Re: lock_limit


Hi Franky,


Dear,

Defining a high value for the lock_limit results in lots of memory
alloction for the locking system.

Damn Right! I found that each 200000 on the lock_limit requires an extra
112M of virtual memory per server to manage.


How can one determine how high this lock_limit parameter must be set ?

My rule of thumb is:
10% Sum over all servers (active_limit) * number of locks per
transaction.

Eg. 3 servers with an active_limit of 150 and
2 servers with an active_limit of 50.
Furthermore, we allow 2000 locks per transaction.

Ergo we would set lock_limit to:
lock_limit = 0.1 * ((3 * 150 + 2 * 50)) * 2000
= 110,000.


The original default setting was 1053132.

Marty

PS. Don't use your thumb as a rule. The lines are all wonky and you
might
hit it with a hammer.

Thanks in advance,

Franky



--
Random Farscape Quote #4:
Jools - Play nice you monochromatic bitch!


--
Random Earthworm Jim Quote #4:
Jim - By the Great Worm Spirit, whose slime burns with the fire of
righteousness!


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.