Consultor Eletrônico



Kbase P85906: How does Buffer Flush works?
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   05/04/2011
Status: Verified

GOAL:

Buffer Flushed Explained

GOAL:

How does Buffer Flush works?

FACT(s) (Environment):

All Supported Operating Systems
Progress/OpenEdge Product Family

FIX:

Writes from the APW "immediate" Queue take place when there are large quantities of modified buffers that have made their way to the "old" end of the LRU chain.

When a process wants to read in a new block into memory, it looks at the "old" end of the LRU chain to find a buffer whose contents can be replaced with the new block. The idea is that a buffer that has not been used for a while is least likely to be needed again in the near future. If the oldest buffer has been modified, it needs to be written to disk before being replaced. It is placed on the APW Queue to be written by the page writers as soon as possible. We do this so that the process that wants to read a block does not have to be delayed by writing the modified buffer.

It may turn out that the next oldest buffer is also modified and is moved to the APW Queue, and also the next, and so on. This is repeated for a maximum of 10 times, after which the process that wants to read the new block will move the buffer to the front of the LRU chain and do the write itself. Then it will use the buffer to store the desired block.

Note that these modified buffers may or may not be on the checkpoint queue. Often under an especially heavy update workload, it turns out that they are not. Thus the page writers are needing to write buffers from the APW Queue that are not scheduled for checkpoint. This means the number of APW Q writes can be larger than the number of buffers that were dirty at the beginning of the checkpoint (the value in the "Dirty" column.

Furthermore, since those buffers are written before they would be placed in the checkpoint queue for later writing, they are no longer dirty and do not show up in the number of dirty buffers at the beginning of the next checkpoint.

A general rule of thumb, if the number of buffers flushed is higher than 10, increase the cluster size, or increase the number of page writers, or increase disk write capacity.