Commit rate
As covered in the previous chapter, how fast data can actually be committed permanently to disk is a critical performance aspect for database transaction processing. It's important to measure this area carefully. Speeds that are dramatically higher than expected are usually a sign one of the write-caches has been put into a volatile write-back mode, which as already explained can result in data loss and database corruption. Some examples of how that can happen will be covered in Chapter 4, Disk Setup.
If you don't have any non-volatile caching available, the basic commit rate for a drive will be similar to its IOPS rating. Luckily PostgreSQL will put multiple transactions into a physical commit if they aren't happening quickly enough.
PostgreSQL test_fsync
In a source code build of PostgreSQL, the src/tools/fsync
directory contains a program named test_fsync
that might also be included in some packaged versions. This aims to test the commit rate for each...