{"Entry":{"collection":"tool","key":"pg-test-fsync","name":"pg_test_fsync","aliases":["pg_test_fsync"],"metadata":{"aliases":["pg_test_fsync"],"category":"Server applications","content_hash":"fd03d7a154df75ef9123bc7b2df97e4337f675b43d44906632263c7594049320","derived_content_hash":"320bb89c31fe46f0431b3b51c5ef9e13f684ebffef878da93f4ee2292fa0984a","imported_at":"2026-09-30T00:40:34.43777+08:00","name":"pg_test_fsync","name_zh":"","slug":"pg-test-fsync","summary":"pg_test_fsync — determine fastest wal_sync_method for PostgreSQL"}},"Definition":{"Collection":"tool","Key":"pg-test-fsync","SourceDatabase":"center","Version":"18","SourceTable":"command_tool","SourceKey":"pg-test-fsync","SourceRevision":"ee8d1a3612338fd9adf250730cb640fcc5233b5491337cc00a316a44e3a0b9f8","Facts":{"comparison_data":{"environment":[],"options":[{"description":"Specifies the file name to write test data in. This file should be in the same file system that the pg_wal directory is or will be placed in. ( pg_wal contains the WAL files.) The default is pg_test_fsync.out in the current directory.","names":["-f","--filename"],"signature":"-f --filename"},{"description":"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 allows the program to complete in under 2 minutes.","names":["-s","--secs-per-test"],"signature":"-s --secs-per-test"},{"description":"Print the pg_test_fsync version and exit.","names":["-V","--version"],"signature":"-V --version"},{"description":"Show help about pg_test_fsync command line arguments, and exit.","names":["-?","--help"],"signature":"-? --help"}],"synopsis":["pg_test_fsync [ option ...]"]},"comparison_hash":"1389a6353245619e571d6357305cd2d322eb179aa5ff5046733d528888531d25","description":["pg_test_fsync — determine fastest wal_sync_method for PostgreSQL"],"description_zh":"描述 pg_test_fsync 旨在让你较为合理地了解，在你的具体系统上哪一种 wal_sync_method 最快，并且在识别出 I/O 问题时提供诊断信息。不过， pg_test_fsync 显示出的差异未必会对实际数据库吞吐量产生显著影响，特别是因为许多数据库服务器的速度瓶颈并不在其预写式日志上。 pg_test_fsync 会为每种 wal_sync_method 报告以微秒计的平均文件同步操作时间，这也可用于为优化 commit_delay 的取值提供参考。 选项 pg_test_fsync 接受下列命令行选项： -f --filename 指定用于写入测试数据的文件名。该文件应位于 pg_wal 目录所在或将要放置的同一文件系统中。（ pg_wal 包含 WAL 文件。）默认值是当前目录中的 pg_test_fsync.out 。 -s --secs-per-test 指定每项测试的秒数。每项测试用时越长，测试结果就越精确，但运行完成所需的时间也越长。默认值是 5 秒，这使程序能够在不到 2 分钟内完成。 -V --version 打印 pg_test_fsync 版本并退出。 -? --help 显示有关 pg_test_fsync 命令行参数的帮助信息并退出。","description_zh_html":"\u003cp\u003e命令行工具 pg_test_fsync [ option ...]。\u003c/p\u003e\u003ch3\u003e同版本中文手册节选\u003c/h3\u003e\u003cdiv class=\"refsect1\"\u003e\u003ch2\u003e描述\u003c/h2\u003e\u003cp\u003e\n\u003cspan class=\"application\"\u003epg_test_fsync\u003c/span\u003e 旨在让你较为合理地了解，在你的具体系统上哪一种 \u003ca class=\"xref\" href=\"/zh/docs/18/runtime-config-wal.html#GUC-WAL-SYNC-METHOD\"\u003ewal_sync_method\u003c/a\u003e 最快，并且在识别出\n  I/O 问题时提供诊断信息。不过，\u003cspan class=\"application\"\u003epg_test_fsync\u003c/span\u003e 显示出的差异未必会对实际数据库吞吐量产生显著影响，特别是因为许多数据库服务器的速度瓶颈并不在其预写式日志上。\u003cspan class=\"application\"\u003epg_test_fsync\u003c/span\u003e 会为每种\n  \u003ccode class=\"literal\"\u003ewal_sync_method\u003c/code\u003e 报告以微秒计的平均文件同步操作时间，这也可用于为优化 \u003ca class=\"xref\" href=\"/zh/docs/18/runtime-config-wal.html#GUC-COMMIT-DELAY\"\u003ecommit_delay\u003c/a\u003e 的取值提供参考。\n \u003c/p\u003e\u003c/div\u003e\u003cdiv class=\"refsect1\"\u003e\u003ch2\u003e选项\u003c/h2\u003e\u003cp\u003e\n\u003cspan class=\"application\"\u003epg_test_fsync\u003c/span\u003e 接受下列命令行选项：\n\n    \u003c/p\u003e\u003cdiv class=\"variablelist\"\u003e\u003cdl class=\"variablelist\"\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-f\u003c/code\u003e\u003cbr/\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--filename\u003c/code\u003e\u003c/span\u003e \u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n        指定用于写入测试数据的文件名。该文件应位于\n        \u003ccode class=\"filename\"\u003epg_wal\u003c/code\u003e 目录所在或将要放置的同一文件系统中。（\u003ccode class=\"filename\"\u003epg_wal\u003c/code\u003e 包含 \u003cacronym class=\"acronym\"\u003eWAL\u003c/acronym\u003e 文件。）默认值是当前目录中的 \u003ccode class=\"filename\"\u003epg_test_fsync.out\u003c/code\u003e。\n       \u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-s\u003c/code\u003e\u003cbr/\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--secs-per-test\u003c/code\u003e\u003c/span\u003e \u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n        指定每项测试的秒数。每项测试用时越长，测试结果就越精确，但运行完成所需的时间也越长。默认值是 5 秒，这使程序能够在不到 2 分钟内完成。\n       \u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-V\u003c/code\u003e\u003cbr/\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--version\u003c/code\u003e\u003c/span\u003e \u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n        打印 \u003cspan class=\"application\"\u003epg_test_fsync\u003c/span\u003e 版本并退出。\n       \u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-?\u003c/code\u003e\u003cbr/\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--help\u003c/code\u003e\u003c/span\u003e \u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n        显示有关 \u003cspan class=\"application\"\u003epg_test_fsync\u003c/span\u003e 命令行参数的帮助信息并退出。\n       \u003c/p\u003e\u003c/dd\u003e\u003c/dl\u003e\u003c/div\u003e\u003cp\u003e\n\u003c/p\u003e\u003c/div\u003e\u003cp\u003e\u003ca href=\"/zh/docs/18/pgtestfsync.html\"\u003e查看完整中文手册与上下文\u003c/a\u003e。\u003c/p\u003e","environment":[],"facts":[{"label":"Documented executable","value":"pg_test_fsync"},{"label":"Executable version","value":"18.6"},{"label":"Reference inventory","value":"Server applications"},{"label":"Option definition groups","value":"4"}],"facts_zh":[{"label":"手册中的可执行程序","value":"pg_test_fsync"},{"label":"程序版本","value":"18.6"},{"label":"参考清单","value":"服务端程序"},{"label":"选项定义组","value":"4"}],"manual_html":"\u003cdiv\u003e\u003cdiv class=\"refentry\" id=\"PGTESTFSYNC\"\u003e\n\u003cdiv class=\"titlepage\"\u003e\u003c/div\u003e\n\u003cdiv class=\"refnamediv\"\u003e\n\u003ch2\u003e\u003cspan class=\"refentrytitle\"\u003e\u003cspan class=\"application\"\u003epg_test_fsync\u003c/span\u003e\u003c/span\u003e\u003c/h2\u003e\n\u003cp\u003epg_test_fsync — determine fastest \u003ccode class=\"varname\"\u003ewal_sync_method\u003c/code\u003e for \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsynopsisdiv\"\u003e\n\u003ch2\u003eSynopsis\u003c/h2\u003e\n\u003cdiv class=\"cmdsynopsis\"\u003e\n\u003cp id=\"id-1.9.5.11.4.1\"\u003e\u003ccode class=\"command\"\u003epg_test_fsync\u003c/code\u003e [\u003cem class=\"replaceable\"\u003e\u003ccode\u003eoption\u003c/code\u003e\u003c/em\u003e...]\u003c/p\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsect1\" id=\"id-1.9.5.11.5\"\u003e\n\u003ch2\u003eDescription\u003c/h2\u003e\n\u003cp\u003e\u003cspan class=\"application\"\u003epg_test_fsync\u003c/span\u003e is intended to give you a reasonable idea of what the fastest \u003ca class=\"xref\" href=\"/docs/18/runtime-config-wal.html#GUC-WAL-SYNC-METHOD\"\u003ewal_sync_method\u003c/a\u003e is on your specific system, as well as supplying diagnostic information in the event of an identified I/O problem. However, differences shown by \u003cspan class=\"application\"\u003epg_test_fsync\u003c/span\u003e might not make any significant difference in real database throughput, especially since many database servers are not speed-limited by their write-ahead logs. \u003cspan class=\"application\"\u003epg_test_fsync\u003c/span\u003e reports average file sync operation time in microseconds for each \u003ccode class=\"literal\"\u003ewal_sync_method\u003c/code\u003e, which can also be used to inform efforts to optimize the value of \u003ca class=\"xref\" href=\"/docs/18/runtime-config-wal.html#GUC-COMMIT-DELAY\"\u003ecommit_delay\u003c/a\u003e.\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsect1\" id=\"id-1.9.5.11.6\"\u003e\n\u003ch2\u003eOptions\u003c/h2\u003e\n\u003cp\u003e\u003cspan class=\"application\"\u003epg_test_fsync\u003c/span\u003e accepts the following command-line options:\u003c/p\u003e\n\u003cdiv class=\"variablelist\"\u003e\n\u003cdl class=\"variablelist\"\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-f\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--filename\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSpecifies the file name to write test data in. This file should be in the same file system that the \u003ccode class=\"filename\"\u003epg_wal\u003c/code\u003e directory is or will be placed in. (\u003ccode class=\"filename\"\u003epg_wal\u003c/code\u003e contains the WAL files.) The default is \u003ccode class=\"filename\"\u003epg_test_fsync.out\u003c/code\u003e in the current directory.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-s\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--secs-per-test\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSpecifies 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 allows the program to complete in under 2 minutes.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-V\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--version\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003ePrint the \u003cspan class=\"application\"\u003epg_test_fsync\u003c/span\u003e version and exit.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-?\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--help\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eShow help about \u003cspan class=\"application\"\u003epg_test_fsync\u003c/span\u003e command line arguments, and exit.\u003c/p\u003e\n\u003c/dd\u003e\n\u003c/dl\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsect1\" id=\"id-1.9.5.11.7\"\u003e\n\u003ch2\u003eEnvironment\u003c/h2\u003e\n\u003cp\u003eThe environment variable \u003ccode class=\"envar\"\u003ePG_COLOR\u003c/code\u003e specifies whether to use color in diagnostic messages. Possible values are \u003ccode class=\"literal\"\u003ealways\u003c/code\u003e, \u003ccode class=\"literal\"\u003eauto\u003c/code\u003e and \u003ccode class=\"literal\"\u003enever\u003c/code\u003e.\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsect1\" id=\"id-1.9.5.11.8\"\u003e\n\u003ch2\u003eSee Also\u003c/h2\u003e\u003cspan class=\"simplelist\"\u003e\u003ca class=\"xref\" href=\"/docs/18/app-postgres.html\" title=\"postgres\"\u003e\u003cspan class=\"refentrytitle\"\u003e\u003cspan class=\"application\"\u003epostgres\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003c/span\u003e\n\u003c/div\u003e\n\u003c/div\u003e\u003c/div\u003e","manual_path":"pgtestfsync.html","options":[{"description":"Specifies the file name to write test data in. This file should be in the same file system that the pg_wal directory is or will be placed in. ( pg_wal contains the WAL files.) The default is pg_test_fsync.out in the current directory.","names":["-f","--filename"],"signature":"-f --filename","source_url":"/docs/18/pgtestfsync.html","summary":"Specifies the file name to write test data in. This file should be in the same file system that the pg_wal directory is or will be placed in. ( pg_wal contains the WAL files.) The default is pg_test_fsync.out in the current directory."},{"description":"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 allows the program to complete in under 2 minutes.","names":["-s","--secs-per-test"],"signature":"-s --secs-per-test","source_url":"/docs/18/pgtestfsync.html","summary":"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 allows the program to complete in under 2 minutes."},{"description":"Print the pg_test_fsync version and exit.","names":["-V","--version"],"signature":"-V --version","source_url":"/docs/18/pgtestfsync.html","summary":"Print the pg_test_fsync version and exit."},{"description":"Show help about pg_test_fsync command line arguments, and exit.","names":["-?","--help"],"signature":"-? --help","source_url":"/docs/18/pgtestfsync.html","summary":"Show help about pg_test_fsync command line arguments, and exit."}],"related":[],"release":{"channel":"stable","evidence_kind":"English manual and source declarations","label":"18.6","major":"18","manifest":{"index":"index.html","major":"18","pages":1148,"pdf":{"A4":{"built_at":"2026-09-26","bytes":15865106,"pages":3154,"sha256":"19512c405da53f9f7fcf0abba359223aa65f021be025bf3411381918f92e3190","url":"/files/documentation/pdf/18/postgresql-18-A4.pdf"},"US":{"built_at":"2026-09-26","bytes":15748059,"pages":3328,"sha256":"facbe6c229e598b872d3d98bef53308f46e06746006fa4590de9a7de9dd46319","url":"/files/documentation/pdf/18/postgresql-18-US.pdf"}},"release":"18.6","source_mode":"en SGML built with pinned official archive","source_sha256":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f","source_url":"https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2","svg_assets":3,"tree":"18"},"ref":"https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2","revision":"ee8d1a3612338fd9adf250730cb640fcc5233b5491337cc00a316a44e3a0b9f8","source_sha256":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f"},"sections":[],"sections_zh":[],"signature":"pg_test_fsync [ option ...]","sources":[{"anchor":"","file":"pgtestfsync.html","label":"18.6 English manual · pgtestfsync.html","sha256":"652324385d110f032bf5ca1885da156d3ec56140284a2971a79ed60c75cc70ef","url":"/docs/18/pgtestfsync.html"},{"anchor":"","file":"reference-server.html","label":"Server applications inventory","sha256":"e9f8bbcc8e3641fadd1d20991e8aad6b532155b786ba5a1b7b364ec4f1a5bef3","url":"/docs/18/reference-server.html"}],"synopsis":["pg_test_fsync [ option ...]"],"tables":[{"columns":[{"key":"signature","label":"Option and arguments"},{"key":"summary","label":"Description"}],"key":"options","rows":[{"signature":{"text":"-f --filename","url":"/docs/18/pgtestfsync.html"},"summary":"Specifies the file name to write test data in. This file should be in the same file system that the pg_wal directory is or will be placed in. ( pg_wal contains the WAL files.) The default is pg_test_fsync.out in the current directory."},{"signature":{"text":"-s --secs-per-test","url":"/docs/18/pgtestfsync.html"},"summary":"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 allows the program to complete in under 2 minutes."},{"signature":{"text":"-V --version","url":"/docs/18/pgtestfsync.html"},"summary":"Print the pg_test_fsync version and exit."},{"signature":{"text":"-? --help","url":"/docs/18/pgtestfsync.html"},"summary":"Show help about pg_test_fsync command line arguments, and exit."}],"title":"Documented options"}],"tables_zh":[{"columns":[{"key":"signature","label":"选项与参数"},{"key":"summary","label":"说明"}],"key":"options","rows":[{"signature":{"text":"-f --filename","url":"/docs/18/pgtestfsync.html"},"summary":"指定用于写入测试数据的文件名。该文件应位于 pg_wal 目录所在或将要放置的同一文件系统中。（ pg_wal 包含 WAL 文件。）默认值是当前目录中的 pg_test_fsync.out 。"},{"signature":{"text":"-s --secs-per-test","url":"/docs/18/pgtestfsync.html"},"summary":"指定每项测试的秒数。每项测试用时越长，测试结果就越精确，但运行完成所需的时间也越长。默认值是 5 秒，这使程序能够在不到 2 分钟内完成。"},{"signature":{"text":"-V --version","url":"/docs/18/pgtestfsync.html"},"summary":"打印 pg_test_fsync 版本并退出。"},{"signature":{"text":"-? --help","url":"/docs/18/pgtestfsync.html"},"summary":"显示有关 pg_test_fsync 命令行参数的帮助信息并退出。"}],"title":"手册中的选项"}],"zh_from":{"authored_translation":"source-derived-identity","body_sha256":"6b5a11680d3ae5dd4bc3941b4c3e78defc39a34f37f10e1480c87a80737d5cec","kind":"same-version-chinese-manual-with-source-derived-identity","manual":{"anchor":"","build_id":107,"extraction":"command-description-and-options","fragment_sha256":"f2ad02ce61447ac414f9ac12475fe393af4039ba774b149fa9f2252008e3a1e3","locale":"zh-Hans","page_key":"pgtestfsync.html","source_hash":"8c5f0ec18c161056636bdb920e2e6495549eb5dd9a63458fd864d031bcfa4e5f","source_revision":"unknown:rendered-translation-baseline","translated_from_revision":null,"translation_revision":"git:b1b500221dbe5437cfca004d6b04d3f6e422765d;html-sha256:08e987a66af27b98444a8057c256314eafa13611a3fb9e888214fc436824244b","url":"/zh/docs/18/pgtestfsync.html","version":"18"},"runtime_rerun":false,"source_facts_revision":"ee8d1a3612338fd9adf250730cb640fcc5233b5491337cc00a316a44e3a0b9f8"}},"ManualEvidence":{"manual_path":"pgtestfsync.html","release":{"channel":"stable","evidence_kind":"English manual and source declarations","label":"18.6","major":"18","manifest":{"index":"index.html","major":"18","pages":1148,"pdf":{"A4":{"built_at":"2026-09-26","bytes":15865106,"pages":3154,"sha256":"19512c405da53f9f7fcf0abba359223aa65f021be025bf3411381918f92e3190","url":"/files/documentation/pdf/18/postgresql-18-A4.pdf"},"US":{"built_at":"2026-09-26","bytes":15748059,"pages":3328,"sha256":"facbe6c229e598b872d3d98bef53308f46e06746006fa4590de9a7de9dd46319","url":"/files/documentation/pdf/18/postgresql-18-US.pdf"}},"release":"18.6","source_mode":"en SGML built with pinned official archive","source_sha256":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f","source_url":"https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2","svg_assets":3,"tree":"18"},"ref":"https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2","revision":"ee8d1a3612338fd9adf250730cb640fcc5233b5491337cc00a316a44e3a0b9f8","source_sha256":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f"},"sources":[{"anchor":"","file":"pgtestfsync.html","label":"18.6 English manual · pgtestfsync.html","sha256":"652324385d110f032bf5ca1885da156d3ec56140284a2971a79ed60c75cc70ef","url":"/docs/18/pgtestfsync.html"},{"anchor":"","file":"reference-server.html","label":"Server applications inventory","sha256":"e9f8bbcc8e3641fadd1d20991e8aad6b532155b786ba5a1b7b364ec4f1a5bef3","url":"/docs/18/reference-server.html"}]},"MeasuredEvidence":{}},"Text":{"Collection":"tool","Key":"pg-test-fsync","SourceDatabase":"center","Version":"18","Locale":"en","Title":"pg_test_fsync","Summary":"pg_test_fsync — determine fastest wal_sync_method for PostgreSQL","BodyHTML":"\u003cdiv\u003e\u003cdiv id=\"PGTESTFSYNC\"\u003e\n\u003cdiv\u003e\u003c/div\u003e\n\u003cdiv\u003e\n\u003ch2\u003e\u003cspan\u003e\u003cspan\u003epg_test_fsync\u003c/span\u003e\u003c/span\u003e\u003c/h2\u003e\n\u003cp\u003epg_test_fsync — determine fastest \u003ccode\u003ewal_sync_method\u003c/code\u003e for \u003cspan\u003ePostgreSQL\u003c/span\u003e\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv\u003e\n\u003ch2\u003eSynopsis\u003c/h2\u003e\n\u003cdiv\u003e\n\u003cp id=\"id-1.9.5.11.4.1\"\u003e\u003ccode\u003epg_test_fsync\u003c/code\u003e [\u003cem\u003e\u003ccode\u003eoption\u003c/code\u003e\u003c/em\u003e...]\u003c/p\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\u003cdiv id=\"id-1.9.5.11.5\"\u003e\n\u003ch2\u003eDescription\u003c/h2\u003e\n\u003cp\u003e\u003cspan\u003epg_test_fsync\u003c/span\u003e is intended to give you a reasonable idea of what the fastest \u003ca href=\"/docs/18/runtime-config-wal.html#GUC-WAL-SYNC-METHOD\" rel=\"nofollow\"\u003ewal_sync_method\u003c/a\u003e is on your specific system, as well as supplying diagnostic information in the event of an identified I/O problem. However, differences shown by \u003cspan\u003epg_test_fsync\u003c/span\u003e might not make any significant difference in real database throughput, especially since many database servers are not speed-limited by their write-ahead logs. \u003cspan\u003epg_test_fsync\u003c/span\u003e reports average file sync operation time in microseconds for each \u003ccode\u003ewal_sync_method\u003c/code\u003e, which can also be used to inform efforts to optimize the value of \u003ca href=\"/docs/18/runtime-config-wal.html#GUC-COMMIT-DELAY\" rel=\"nofollow\"\u003ecommit_delay\u003c/a\u003e.\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv id=\"id-1.9.5.11.6\"\u003e\n\u003ch2\u003eOptions\u003c/h2\u003e\n\u003cp\u003e\u003cspan\u003epg_test_fsync\u003c/span\u003e accepts the following command-line options:\u003c/p\u003e\n\u003cdiv\u003e\n\u003cdl\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-f\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan\u003e\u003ccode\u003e--filename\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSpecifies the file name to write test data in. This file should be in the same file system that the \u003ccode\u003epg_wal\u003c/code\u003e directory is or will be placed in. (\u003ccode\u003epg_wal\u003c/code\u003e contains the WAL files.) The default is \u003ccode\u003epg_test_fsync.out\u003c/code\u003e in the current directory.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-s\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan\u003e\u003ccode\u003e--secs-per-test\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSpecifies the number of seconds for each test. The more time per test, the greater the test\u0026#39;s accuracy, but the longer it takes to run. The default is 5 seconds, which allows the program to complete in under 2 minutes.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-V\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan\u003e\u003ccode\u003e--version\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003ePrint the \u003cspan\u003epg_test_fsync\u003c/span\u003e version and exit.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-?\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan\u003e\u003ccode\u003e--help\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eShow help about \u003cspan\u003epg_test_fsync\u003c/span\u003e command line arguments, and exit.\u003c/p\u003e\n\u003c/dd\u003e\n\u003c/dl\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\u003cdiv id=\"id-1.9.5.11.7\"\u003e\n\u003ch2\u003eEnvironment\u003c/h2\u003e\n\u003cp\u003eThe environment variable \u003ccode\u003ePG_COLOR\u003c/code\u003e specifies whether to use color in diagnostic messages. Possible values are \u003ccode\u003ealways\u003c/code\u003e, \u003ccode\u003eauto\u003c/code\u003e and \u003ccode\u003enever\u003c/code\u003e.\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv id=\"id-1.9.5.11.8\"\u003e\n\u003ch2\u003eSee Also\u003c/h2\u003e\u003cspan\u003e\u003ca href=\"/docs/18/app-postgres.html\" title=\"postgres\" rel=\"nofollow\"\u003e\u003cspan\u003e\u003cspan\u003epostgres\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003c/span\u003e\n\u003c/div\u003e\n\u003c/div\u003e\u003c/div\u003e","SourceRevision":"ee8d1a3612338fd9adf250730cb640fcc5233b5491337cc00a316a44e3a0b9f8","ContentHash":"7e89a840e588b07777377a3f890c251b4243e69839f588318c5fcacef3714f04","Payload":{"description":["pg_test_fsync — determine fastest wal_sync_method for PostgreSQL"],"manual_html":"\u003cdiv\u003e\u003cdiv class=\"refentry\" id=\"PGTESTFSYNC\"\u003e\n\u003cdiv class=\"titlepage\"\u003e\u003c/div\u003e\n\u003cdiv class=\"refnamediv\"\u003e\n\u003ch2\u003e\u003cspan class=\"refentrytitle\"\u003e\u003cspan class=\"application\"\u003epg_test_fsync\u003c/span\u003e\u003c/span\u003e\u003c/h2\u003e\n\u003cp\u003epg_test_fsync — determine fastest \u003ccode class=\"varname\"\u003ewal_sync_method\u003c/code\u003e for \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsynopsisdiv\"\u003e\n\u003ch2\u003eSynopsis\u003c/h2\u003e\n\u003cdiv class=\"cmdsynopsis\"\u003e\n\u003cp id=\"id-1.9.5.11.4.1\"\u003e\u003ccode class=\"command\"\u003epg_test_fsync\u003c/code\u003e [\u003cem class=\"replaceable\"\u003e\u003ccode\u003eoption\u003c/code\u003e\u003c/em\u003e...]\u003c/p\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsect1\" id=\"id-1.9.5.11.5\"\u003e\n\u003ch2\u003eDescription\u003c/h2\u003e\n\u003cp\u003e\u003cspan class=\"application\"\u003epg_test_fsync\u003c/span\u003e is intended to give you a reasonable idea of what the fastest \u003ca class=\"xref\" href=\"/docs/18/runtime-config-wal.html#GUC-WAL-SYNC-METHOD\"\u003ewal_sync_method\u003c/a\u003e is on your specific system, as well as supplying diagnostic information in the event of an identified I/O problem. However, differences shown by \u003cspan class=\"application\"\u003epg_test_fsync\u003c/span\u003e might not make any significant difference in real database throughput, especially since many database servers are not speed-limited by their write-ahead logs. \u003cspan class=\"application\"\u003epg_test_fsync\u003c/span\u003e reports average file sync operation time in microseconds for each \u003ccode class=\"literal\"\u003ewal_sync_method\u003c/code\u003e, which can also be used to inform efforts to optimize the value of \u003ca class=\"xref\" href=\"/docs/18/runtime-config-wal.html#GUC-COMMIT-DELAY\"\u003ecommit_delay\u003c/a\u003e.\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsect1\" id=\"id-1.9.5.11.6\"\u003e\n\u003ch2\u003eOptions\u003c/h2\u003e\n\u003cp\u003e\u003cspan class=\"application\"\u003epg_test_fsync\u003c/span\u003e accepts the following command-line options:\u003c/p\u003e\n\u003cdiv class=\"variablelist\"\u003e\n\u003cdl class=\"variablelist\"\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-f\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--filename\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSpecifies the file name to write test data in. This file should be in the same file system that the \u003ccode class=\"filename\"\u003epg_wal\u003c/code\u003e directory is or will be placed in. (\u003ccode class=\"filename\"\u003epg_wal\u003c/code\u003e contains the WAL files.) The default is \u003ccode class=\"filename\"\u003epg_test_fsync.out\u003c/code\u003e in the current directory.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-s\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--secs-per-test\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSpecifies 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 allows the program to complete in under 2 minutes.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-V\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--version\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003ePrint the \u003cspan class=\"application\"\u003epg_test_fsync\u003c/span\u003e version and exit.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-?\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--help\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eShow help about \u003cspan class=\"application\"\u003epg_test_fsync\u003c/span\u003e command line arguments, and exit.\u003c/p\u003e\n\u003c/dd\u003e\n\u003c/dl\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsect1\" id=\"id-1.9.5.11.7\"\u003e\n\u003ch2\u003eEnvironment\u003c/h2\u003e\n\u003cp\u003eThe environment variable \u003ccode class=\"envar\"\u003ePG_COLOR\u003c/code\u003e specifies whether to use color in diagnostic messages. Possible values are \u003ccode class=\"literal\"\u003ealways\u003c/code\u003e, \u003ccode class=\"literal\"\u003eauto\u003c/code\u003e and \u003ccode class=\"literal\"\u003enever\u003c/code\u003e.\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsect1\" id=\"id-1.9.5.11.8\"\u003e\n\u003ch2\u003eSee Also\u003c/h2\u003e\u003cspan class=\"simplelist\"\u003e\u003ca class=\"xref\" href=\"/docs/18/app-postgres.html\" title=\"postgres\"\u003e\u003cspan class=\"refentrytitle\"\u003e\u003cspan class=\"application\"\u003epostgres\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003c/span\u003e\n\u003c/div\u003e\n\u003c/div\u003e\u003c/div\u003e","related":[],"sections":[],"tables":[{"columns":[{"key":"signature","label":"Option and arguments"},{"key":"summary","label":"Description"}],"key":"options","rows":[{"signature":{"text":"-f --filename","url":"/docs/18/pgtestfsync.html"},"summary":"Specifies the file name to write test data in. This file should be in the same file system that the pg_wal directory is or will be placed in. ( pg_wal contains the WAL files.) The default is pg_test_fsync.out in the current directory."},{"signature":{"text":"-s --secs-per-test","url":"/docs/18/pgtestfsync.html"},"summary":"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 allows the program to complete in under 2 minutes."},{"signature":{"text":"-V --version","url":"/docs/18/pgtestfsync.html"},"summary":"Print the pg_test_fsync version and exit."},{"signature":{"text":"-? --help","url":"/docs/18/pgtestfsync.html"},"summary":"Show help about pg_test_fsync command line arguments, and exit."}],"title":"Documented options"}]}},"RequestedLocale":"en","Fallback":false,"Versions":["10","11","12","13","14","15","16","17","18","19","20"],"Locales":["en","zh-Hans"],"Signatures":null,"Spellings":null,"SQLState":null,"Evidence":null}
