PG_TEST_FSYNC(1)

✨ NAME ✨

pg_test_fsync β€” bestie, it figures out the fastest wal_sync_method for your PostgreSQL πŸ’…


🌸 SYNOPSIS 🌸

pg_test_fsync [option...]

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so picture this: you wanna know which wal_sync_method is actually the fastest on your specific system, right? that's literally what pg_test_fsync is for 🫢 it gives you a reasonable idea of that, plus it hands over diagnostic info if there's an I/O problem it manages to identify. it's giving detective energy.

but real talk β€” the differences it shows you might not make any significant difference in real database throughput. especially since a lot of database servers aren't even speed-limited by their write-ahead logs. so don't spiral, bestie πŸ’–

here's the cute part: pg_test_fsync reports the average file sync operation time in microseconds for each wal_sync_method. and you can also use those numbers to inform your efforts to optimize the value of commit_delay. two birds, one slay ✨


πŸ’… OPTIONS πŸ’…

pg_test_fsync accepts the following command-line options:

  • -f, --filename β€” specifies the file name to write test data in. this file should live in the same file system that the pg_wal directory is or will be placed in. (pg_wal contains the WAL files, fyi πŸ‘‘) the default is pg_test_fsync.out in the current directory.
  • -s, --secs-per-test β€” specifies the number of seconds for each test. the more time per test, the greater the test's accuracy, but the longer it takes to run. the default is 5 seconds, which lets the program complete in under 2 minutes. accuracy vs. patience, pick your fighter 😭
  • -V, --version β€” print the pg_test_fsync version and exit. short and sweet, periodt.
  • -?, --help β€” show help about pg_test_fsync command line arguments, and exit. your lil emergency exit πŸŽ€

🌈 ENVIRONMENT 🌈

the environment variable PG_COLOR specifies whether to use color in diagnostic messages. possible values are always, auto and never. a little rainbow in your terminal? yes please 🌸


⭐ SEE ALSO ⭐


and that's the whole vibe, bestie β€” this is from PostgreSQL 18.6, dated 2026, so you know it's fresh πŸ’œ go forth and sync responsibly βœ¨πŸ¦‹