Shared-memory buffer pool

The buffer pool in the resident portion of shared memory contains buffers that store dbspace pages read from disk. The pool of buffers comprises the largest allocation of the resident portion of shared memory.

The following figure illustrates the shared-memory header and the buffer pool.
Figure 1: Shared-memory buffer pool

The paragraphs that precede this figure describe the content of the figure.

You use the BUFFERPOOL configuration parameter to specify information about a buffer pool, including the number of buffers in the buffer pool. Each buffer is the size of one database server page. To allocate the appropriate number of buffers, start with at least four buffers per user. For more than 500 users, the minimum requirement is 2000 buffers. Too few buffers can severely affect performance, so you must monitor the database server and tune the value of buffers to determine an acceptable value.

If you are creating a dbspace with a non-default page size, the dbspace must have a corresponding buffer pool. If a buffer pool for a non-default page size does not exist, the database server automatically creates a large-page buffer. For example, if you create a dbspace with a page size of 6 KB, the database server creates a buffer pool with a size of 6 KB.

If the database server is in online, quiescent, or administration mode, you can also use the onparams -b command to add a new buffer pool of a different size. When you use the onparams -b command, the information you specify is automatically transferred to the onconfig file as a new entry of the BUFFERPOOL configuration parameter.

Because the maximum number of buffers in 64-bit addressing can be as large as 231-1, the resident portion of shared memory might not be able to hold all of the buffers in a large buffer pool. In this case, the virtual portion of database server shared memory might hold some of the buffers.

In general, the database server performs I/O in full-page units, the size of a buffer. The exceptions are I/O performed from big buffers, from blobspace buffers, or from lightweight I/O buffers.

Automatic LRU (least recently used) tuning affects all buffer pools and adjusts the lru_min_dirty and lru_max_dirty values in the BUFFERPOOL configuration parameter.

The status of the buffers is tracked through the buffer table. Within shared memory, buffers are organized into FIFO/LRU buffer queues. Buffer acquisition is managed by mutexes and lock-access information.

The onstat -b command displays information about the buffers. The LG_ADDBPOOL log record and the sysbufpool system catalog table contain information about each buffer pool.