summaryrefslogtreecommitdiff
path: root/src/include/pgstat.h
diff options
context:
space:
mode:
authorRobert Haas2010-11-15 17:42:59 +0000
committerRobert Haas2010-11-15 17:42:59 +0000
commit3134d8863e8473e3ed791e27d484f9e548220411 (patch)
tree57892334bf423c03ac4d69265ea15adc31977af0 /src/include/pgstat.h
parent8d70ed84ba577abf9e985518024fb92e2081dac9 (diff)
Add new buffers_backend_fsync field to pg_stat_bgwriter.
This new field counts the number of times that a backend which writes a buffer out to the OS must also fsync() it. This happens when the bgwriter fsync request queue is full, and is generally detrimental to performance, so it's good to know when it's happening. Along the way, log a new message at level DEBUG1 whenever we fail to hand off an fsync, so that the problem can also be seen in examination of log files (if the logging level is cranked up high enough). Greg Smith, with minor tweaks by me.
Diffstat (limited to 'src/include/pgstat.h')
-rw-r--r--src/include/pgstat.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/include/pgstat.h b/src/include/pgstat.h
index d49bd80526..42bf9c4f3a 100644
--- a/src/include/pgstat.h
+++ b/src/include/pgstat.h
@@ -360,6 +360,7 @@ typedef struct PgStat_MsgBgWriter
PgStat_Counter m_buf_written_clean;
PgStat_Counter m_maxwritten_clean;
PgStat_Counter m_buf_written_backend;
+ PgStat_Counter m_buf_fsync_backend;
PgStat_Counter m_buf_alloc;
} PgStat_MsgBgWriter;
@@ -562,6 +563,7 @@ typedef struct PgStat_GlobalStats
PgStat_Counter buf_written_clean;
PgStat_Counter maxwritten_clean;
PgStat_Counter buf_written_backend;
+ PgStat_Counter buf_fsync_backend;
PgStat_Counter buf_alloc;
} PgStat_GlobalStats;