If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > how to calculate DB memory?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-21-09, 16:34
MarkhamDBA MarkhamDBA is offline
Registered User
 
Join Date: Dec 2008
Location: Toronto, Canada
Posts: 381
how to calculate DB memory?

(DB2 v8.2 ESE on AIX v5.3) trying to calculate how much memory DB takes. According to documentation: "If this amount [DATABASE_MEMORY] is less than the amount calculated from the 1 individual parameters (for example, locklist, utility heap, 1 bufferpools, and so on), the larger amount will be used. "
What exactly are the individual db cfg params to be used for memory calculation? Here is an exerpts from our db cfg:

Database heap (4KB) (DBHEAP) = 3000
Size of database shared memory (4KB) (DATABASE_MEMORY) = AUTOMATIC(37676)
Catalog cache size (4KB) (CATALOGCACHE_SZ) = (MAXAPPLS*4) 40x4=160
Log buffer size (4KB) (LOGBUFSZ) = 8
Utilities heap size (4KB) (UTIL_HEAP_SZ) = 5000
Buffer pool size (pages) (BUFFPAGE) = 20000
Extended storage segments size (4KB) (ESTORE_SEG_SZ) = 16000
Max storage for lock list (4KB) (LOCKLIST) = 100

Max size of appl. group mem set (4KB) (APPGROUP_MEM_SZ) = 30000
Max appl. control heap size (4KB) (APP_CTL_HEAP_SZ) = 128
Sort heap thres for shared sorts (4KB) (SHEAPTHRES_SHR) = (SHEAPTHRES) 20000
Sort list heap (4KB) (SORTHEAP) = 256
SQL statement heap (4KB) (STMTHEAP) = 4096
Default application heap (4KB) (APPLHEAPSZ) = 512
Package cache size (4KB) (PCKCACHESZ) = (MAXAPPLS*8) 40x8=320
Statistics heap size (4KB) (STAT_HEAP_SZ) = 4384
__________________
DB2 v9.5 ESE on AIX v6.1/ v9./10 on z/OS
Reply With Quote
  #2 (permalink)  
Old 05-21-09, 17:32
db2girl db2girl is offline
∞∞∞∞∞∞
 
Join Date: Aug 2008
Location: Toronto, Canada
Posts: 1,816
please take a look at the following article:
The DB2 UDB memory model

Search for "formula"
Reply With Quote
  #3 (permalink)  
Old 05-22-09, 10:08
MarkhamDBA MarkhamDBA is offline
Registered User
 
Join Date: Dec 2008
Location: Toronto, Canada
Posts: 381
Quote:
Originally Posted by db2girl
please take a look at the following article:
The DB2 UDB memory model

Search for "formula"
This is awesome. Spasibo, Bella.

Why the formula does not include SORTHEAP and BUFFPAGE sizes?

The article does not mention size of hidden bufferpools but I did a search on hidden bufferpools and found that each of them is of 16 page size.
__________________
DB2 v9.5 ESE on AIX v6.1/ v9./10 on z/OS

Last edited by MarkhamDBA; 05-22-09 at 10:19.
Reply With Quote
  #4 (permalink)  
Old 05-22-09, 10:27
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,196
Quote:
Originally Posted by MarkhamDBA
This is awesome. Spasibo, Bella.

Why the formula does not include SORTHEAP and BUFFPAGE sizes?

The article does not mention size of hidden bufferpools but I did a search on hidden bufferpools and found that each of them is of 16 page size.
BUFFPAGE is obsolete (will be removed in a future release) and should not be used. It is only active if a bufferpool size is set to -1 (select * from syscat.bufferpools).
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390
Reply With Quote
  #5 (permalink)  
Old 05-22-09, 10:32
MarkhamDBA MarkhamDBA is offline
Registered User
 
Join Date: Dec 2008
Location: Toronto, Canada
Posts: 381
Quote:
Originally Posted by Marcus_A
BUFFPAGE is obsolete (will be removed in a future release) and should not be used. It is only active if a bufferpool size is set to -1 (select * from syscat.bufferpools).
In what DB2 version is BUFFPAGE obsolete, Marcus? I am doing calculations for DB2 v8.2. Thanks
__________________
DB2 v9.5 ESE on AIX v6.1/ v9./10 on z/OS
Reply With Quote
  #6 (permalink)  
Old 05-22-09, 11:16
db2girl db2girl is offline
∞∞∞∞∞∞
 
Join Date: Aug 2008
Location: Toronto, Canada
Posts: 1,816
When intra_parallel or concentrator is off, sorts are private. Private sorts are allocated out of agent private memory ("ulimit -d" setting) so sortheap is not included into the calculation.

For shared sorts, you need to use the second formula which also counts sheapthres_shr.

Please check the following URL regarding buffpage:
DB2 Universal Database
Reply With Quote
  #7 (permalink)  
Old 05-22-09, 12:59
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,196
Quote:
Originally Posted by MarkhamDBA
In what DB2 version is BUFFPAGE obsolete, Marcus? I am doing calculations for DB2 v8.2. Thanks
Although BUFFPAGE is still working in the latest release (9.5) IBM has indicated that it is depricated and will be removed in a future release (no mention of when that will be), so do not use it. It is only applicable to bufferpools where the size is set to -1 in syscat.bufferpools.
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390
Reply With Quote
  #8 (permalink)  
Old 05-22-09, 13:22
MarkhamDBA MarkhamDBA is offline
Registered User
 
Join Date: Dec 2008
Location: Toronto, Canada
Posts: 381
Quote:
Originally Posted by Marcus_A
Although BUFFPAGE is still working in the latest release (9.5) IBM has indicated that it is depricated and will be removed in a future release (no mention of when that will be), so do not use it. It is only applicable to bufferpools where the size is set to -1 in syscat.bufferpools.
one of our production databases has only one bufferpool IBMDEFAULTBP and it has NPAGES=-1. Does it mean that I should add (BUFFPAGE) = 100000 to database shared memory calculation? Thanks Marcus
__________________
DB2 v9.5 ESE on AIX v6.1/ v9./10 on z/OS
Reply With Quote
  #9 (permalink)  
Old 05-22-09, 15:01
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,196
Quote:
Originally Posted by MarkhamDBA
one of our production databases has only one bufferpool IBMDEFAULTBP and it has NPAGES=-1. Does it mean that I should add (BUFFPAGE) = 100000 to database shared memory calculation? Thanks Marcus
You can run db2mtrk (see Command Reference for options) to see the actual bufferpool memory being used.

But yes, if your bufferpool size is -1, you are using the value in the BUFFPAGE setting. I would recommend that you alter the bufferpool and set the size explicitly, and set BUFFPAGE back to 1000.
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On