Tips for Determining Checkpoint Intervals

From InterBase
Jump to: navigation, search

Go Up to Enabling Journaling and Creating Journal Files


InterBase uses the checkpoint interval to determine how long it takes InterBase to recover after a server crash. If the server crashes, all of the changes in the cache will be lost. This is okay because the changes were written synchronously to the journal, which stores them on disk, but not in the database. When the server restarts, it must read all of the journal files and copy the changes in the journal to the database to bring the database file up-to-date. The more journal files there are, the longer this will take. Performing frequent checkpoints means that the changes in the cache are written to the database frequently, so fewer changes are kept in the journal. This in turn means that fewer journal files are required and recovery will take less time.

You can use the following equations to help you determine the most effective checkpoint interval for your system:

(checkpoint length * journal page size) / (database page size * writes/minutes) = # of minutes between checkpoints

To help determine the time your system needs to recover, use this equation:

(checkpoint length * journal page size) / 1,048,576 = maximum time to recover after a crash in seconds
Note: This equation assumes that the journal file is processed at a rate of one megabyte per second during crash recovery. Typically, a journal file is processed at one to two megabytes per second.

To determine checkpoint length for a given recovery time, use this equation:

(recovery time in seconds * 1,048,576) / journal page size = checkpoint length