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 thepg_waldirectory is or will be placed in. (pg_walcontains the WAL files, fyi π) the default ispg_test_fsync.outin 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 thepg_test_fsyncversion and exit. short and sweet, periodt.-?,--helpβ show help aboutpg_test_fsynccommand 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 β¨π¦
π¦ where this page comes from
- alpine 3.23: postgresql18-doc 18.6-r0 Β· PostgreSQL
- alpine 3.24: postgresql18-doc 18.6-r0 Β· PostgreSQL
- arch rolling: postgresql 18.6-4 Β· PostgreSQL
- fedora 43: postgresql-contrib 18.6-1.fc43 Β· PostgreSQL
- fedora 44: postgresql-contrib 18.6-1.fc44 Β· PostgreSQL
- nixos 26.05: postgresql 18.6
- ubuntu resolute: postgresql-18 18.6-0ubuntu0.26.04.1 Β· PostgreSQL
- ubuntu stonking: postgresql-18 18.6-3build2 Β· PostgreSQL
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms