Consultor Eletrônico



Kbase P109158: -Mf parameter - What does it really do?
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   16/01/2006
Status: Unverified

GOAL:

-Mf parameter - What does it really do?

GOAL:

What does the -Mf parameter?

GOAL:

Why to use the -Mf parameter?

GOAL:

How -Mf affects transaction consistency?

FIX:


To enforce transaction consistency, every time a COMMIT note is logged, the buffer containing that note immediately must be flushed. If a system crash occurs, the database can recover and recover the transaction associated with that COMMIT because it was flushed out to disk.

In order to adhere to Write Ahead Logging, all writes to the BI file must be done UNBUFFERED.

The -Mf parameter relaxes the rule that a COMMIT note forces a flush.

By doing this, the COMMIT note goes into the buffer and inform the client that the transaction has committed. In the event of a system crash, the transaction commit would not be in the BI file, hence the transaction would be backed out. It is all right to do this provided the end users check to see that their last transaction were committed after the system comes up.

The default for -Mf is 3. If a COMMIT note gets logged, then the buffer will be flushed to disk in one of two ways.

- the buffer fills up
- three seconds have passed

The hope is that more than 1 COMMIT note will be logged in a BI buffer.

On a very busy system, the amount of time it takes for a BI buffer to fill up is milliseconds. On a slow system without a lot of update activity, it could take the full 3 seconds to flush out the COMMIT note.

NOTE: Turning on 2 phase commit forces the -Mf parameter to be 0, hence disallowing this optimization.

The -biblocksize parameter plays a role in performance with -Mf. The larger the -biblocksize, the more likely multiple COMMIT notes reside in a BI buffer, hence performance can be improved.

Here is an example:

3 COMMIT notes in a row all get put into 1 BI buffer.

With -Mf 0, this would cause 3 UNBUFFERED writes to the BI file; with -Mf 3, there would be 1 UNBUFFERED write to the BI file, either when the buffer is completely full, or when 3 seconds have passed.