1<!--
2doc/src/sgml/ref/pgtestfsync.sgml
3PostgreSQL documentation
4-->
5
6<refentry id="pgtestfsync">
7 <indexterm zone="pgtestfsync">
8  <primary>pg_test_fsync</primary>
9 </indexterm>
10
11 <refmeta>
12  <refentrytitle><application>pg_test_fsync</application></refentrytitle>
13  <manvolnum>1</manvolnum>
14  <refmiscinfo>Application</refmiscinfo>
15 </refmeta>
16
17 <refnamediv>
18  <refname>pg_test_fsync</refname>
19  <refpurpose>determine fastest <varname>wal_sync_method</varname> for <productname>PostgreSQL</productname></refpurpose>
20 </refnamediv>
21
22 <refsynopsisdiv>
23  <cmdsynopsis>
24   <command>pg_test_fsync</command>
25   <arg rep="repeat"><replaceable>option</replaceable></arg>
26  </cmdsynopsis>
27 </refsynopsisdiv>
28
29 <refsect1>
30  <title>Description</title>
31
32 <para>
33  <application>pg_test_fsync</> is intended to give you a reasonable
34  idea of what the fastest <xref linkend="guc-wal-sync-method"> is on your
35  specific system,
36  as well as supplying diagnostic information in the event of an identified I/O
37  problem.  However, differences shown by
38  <application>pg_test_fsync</application> might not make any significant
39  difference in real database throughput, especially since many database servers
40  are not speed-limited by their write-ahead logs.
41  <application>pg_test_fsync</application> reports average file sync operation
42  time in microseconds for each <literal>wal_sync_method</literal>, which can also be used to
43  inform efforts to optimize the value of <xref linkend="guc-commit-delay">.
44 </para>
45 </refsect1>
46
47 <refsect1>
48  <title>Options</title>
49
50   <para>
51    <application>pg_test_fsync</application> accepts the following
52    command-line options:
53
54    <variablelist>
55
56     <varlistentry>
57      <term><option>-f</option></term>
58      <term><option>--filename</option></term>
59      <listitem>
60       <para>
61        Specifies the file name to write test data in.
62        This file should be in the same file system that the
63        <filename>pg_wal</> directory is or will be placed in.
64        (<filename>pg_wal</> contains the <acronym>WAL</> files.)
65        The default is <filename>pg_test_fsync.out</> in the current
66        directory.
67       </para>
68      </listitem>
69     </varlistentry>
70
71     <varlistentry>
72      <term><option>-s</option></term>
73      <term><option>--secs-per-test</option></term>
74      <listitem>
75       <para>
76        Specifies the number of seconds for each test.  The more time
77        per test, the greater the test's accuracy, but the longer it takes
78        to run.  The default is 5 seconds, which allows the program to
79        complete in under 2 minutes.
80       </para>
81      </listitem>
82     </varlistentry>
83
84     <varlistentry>
85      <term><option>-V</></term>
86      <term><option>--version</></term>
87      <listitem>
88       <para>
89        Print the <application>pg_test_fsync</application> version and exit.
90       </para>
91      </listitem>
92     </varlistentry>
93
94     <varlistentry>
95      <term><option>-?</></term>
96      <term><option>--help</></term>
97      <listitem>
98       <para>
99        Show help about <application>pg_test_fsync</application> command line
100        arguments, and exit.
101       </para>
102      </listitem>
103     </varlistentry>
104    </variablelist>
105   </para>
106
107 </refsect1>
108
109 <refsect1>
110  <title>See Also</title>
111
112  <simplelist type="inline">
113   <member><xref linkend="app-postgres"></member>
114  </simplelist>
115 </refsect1>
116</refentry>
117