Calculating buffer pool size

Buffer pools are areas of virtual storage that are used to satisfy the buffering requirements for one or more table spaces or indexes. All Db2 subsystems use virtual buffer pools, which are backed by central storage or auxiliary storage. Buffer pools are created above the 2 GB bar.

About this task

Virtual buffer pools: For best results, use at least 100 KB of buffer pool space for each concurrent user. A value of 300 KB or more is recommended for improved performance. Very simple SQL statements that access small amounts of data can require less than this amount. Complex SQL statements that access large amounts of data can require more than this amount. Dynamic SQL statements might require a dynamic bind, which requires additional buffers for catalog tables and indexes. If an SQL statement requires directory access, additional buffers are also required for directory page sets. UPDATE, DELETE, and INSERT statements require more buffers to keep updated pages in a buffer pool.

To efficiently support prefetch, allow 400 KB for each object that is concurrently accessed. For example, if you have a SELECT statement with a single table space scan, allow 400 KB for that statement. For another example, suppose you have a SELECT statement with a three-table sort merge join that uses an index for each table, and a parallel degree of 4. To obtain a rough estimate, calculate the total number of objects that are accessed and multiply the number of objects by 400 KB and then by the degree of parallelism. In this example, the equation would be (3 tables + 3 indexes + 1 work file for the sort) x 400 KB x 4. The result is 11200 KB that is recommended for this statement. Typically, these objects should be defined in separate buffer pools to provide better performance control. For example, you should have at least three separate buffer pools: one for indexes, one for tables, and one for work files.

During installation, you can set the buffer pool sizes on the installation panels. Later, you can use the ALTER BUFFERPOOL command to alter the sizes and other attributes of as many as 50 buffer pools for 4-KB page sets, 10 buffer pools for 8-KB page sets, 10 buffer pools for 16-KB page sets, and 10 buffer pools for 32-KB table spaces. The ALTER BUFFERPOOL command can make the changes dynamically while Db2 is running.

Important: Do not allocate more storage for buffer pools than available real storage for buffer pools. If you attempt to use more than the available real storage, performance will suffer.
Db2 limits the total amount of storage that is allocated for virtual buffer pools to approximately twice the amount of real storage. If you specify more than this amount for virtual buffer pools, Db2 allocates buffer pools during startup until twice the amount of real storage is used. Db2 then allocates the remaining buffer pools as follows:
Page size Number of pages
4 KB 2000
8 KB 1000
16 KB 500
32 KB 250
After these storage limits have been reached, you cannot increase the amount of virtual buffer pool storage unless you increase the amount of real storage that is available to the z/OS® image.

Procedure

To calculate the virtual buffer pool sizes for your subsystem:

Use the following table.

Table 1. Virtual buffer pool size calculation
Virtual buffer pool calculation Default
Buffers for BP0 ____ x 4 KB = _____ 20,000 x 4 KB = 80,000 KB
Buffers for BP1 +____ x 4 KB = _____ + 0 x 4 KB = 0 KB
Buffers for BP2 +____ x 4 KB = _____ + 0 x 4 KB = 0 KB
.      
.      
.      
Buffers for BP49 +____ x 4 KB = _____ + 0 x 4 KB = 0 KB
Buffers for BP8K0 +____ x 8 KB = _____ + 1000 x 8 KB = 8000 KB
Buffers for BP8K1 +____ x 8 KB = _____ + 0 x 8 KB = 0 KB
.      
.      
Buffers for BP16K0 +___ x 16 KB = ____ + 500 x 16 KB = 8000 KB
Buffers for BP16K1 +___ x 16 KB = ____ + 0 x 16 KB = 0 KB
.      
.      
Buffers for BP32K +___ x 32 KB = ____ +250 x 32 KB = 8000 KB
.      
.      
Buffers for BP32K9 +___ x 32 KB = ____ + 0 x 32 KB = 0 KB
  = ____   = 104,000KB