Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit82e4297

Browse files
Add microsecs/op display to pg_test_fsync utility
e.g. fsync 2103.613 ops/sec ( 475 microsecs/op)Peter Geoghegan
1 parentbc43331 commit82e4297

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

‎contrib/pg_test_fsync/pg_test_fsync.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@
2525

2626
#defineLABEL_FORMAT" %-32s"
2727
#defineNA_FORMAT"%18s"
28-
#defineOPS_FORMAT"%9.3f ops/sec"
28+
#defineOPS_FORMAT"%9.3f ops/sec (%6.f microsecs/op)"
29+
#defineUSECS_SEC1000000
2930

3031
/* These are macros to avoid timing the function call overhead. */
3132
#ifndefWIN32
@@ -568,8 +569,9 @@ print_elapse(struct timeval start_t, struct timeval stop_t, int ops)
568569
doubletotal_time= (stop_t.tv_sec-start_t.tv_sec)+
569570
(stop_t.tv_usec-start_t.tv_usec)*0.000001;
570571
doubleper_second=ops /total_time;
572+
doubleavg_op_time_us= (total_time /ops)*USECS_SEC;
571573

572-
printf(OPS_FORMAT"\n",per_second);
574+
printf(OPS_FORMAT"\n",per_second,avg_op_time_us);
573575
}
574576

575577
#ifndefWIN32

‎doc/src/sgml/pgtestfsync.sgml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,14 @@
3030
<application>pg_test_fsync</> is intended to give you a reasonable
3131
idea of what the fastest <xref linkend="guc-wal-sync-method"> is on your
3232
specific system,
33-
as well as supplying diagnostic information in the event of an
34-
identified I/O problem. However, differences shown by <application>pg_test_fsync</application>
35-
might not make any difference in real database throughput, especially
36-
since many database servers are not speed-limited by their transaction
37-
logs.
33+
as well as supplying diagnostic information in the event of an identified I/O
34+
problem. However, differences shown by
35+
<application>pg_test_fsync</application> might not make any significant
36+
difference in real database throughput, especially since many database servers
37+
are not speed-limited by their transaction logs.
38+
<application>pg_test_fsync</application> reports average file sync operation
39+
time in microseconds for each wal_sync_method, which can be used to inform
40+
efforts to optimize the value of <varname>commit_delay</varname>.
3841
</para>
3942
</refsect1>
4043

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp