fsync commit rate

It's possible to use sysbench to measure how fast commits can be flushed to disk, using the standard fsync call just like the database defaults to. Note that in this case, the file size being used is 16384 bytes, even though PostgreSQL block writes are 8192 bytes. The version tested here didn't work correctly with the block size reduced that far, and as the actual amount of bytes doesn't impact the commit rate until it becomes much larger anyway, that's not worth worrying about. The following is a Linux-specific script that includes disabling, and then re-enabling, the drive's write cache, but the basic sysbench call can be used on any platform the program runs on:

#!/bin/sh DRIVE="/dev/sda" PREFIX="$HOME/sysbench-0.4.10" ...

Get PostgreSQL 10 High Performance now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.