About to add WAL write/fsync statistics to pg_stat_wal view

Поиск
Список
Период
Сортировка
От Masahiro Ikeda
Тема About to add WAL write/fsync statistics to pg_stat_wal view
Дата
Msg-id 0509ad67b585a5b86a83d445dfa75392@oss.nttdata.com
обсуждение исходный текст
Ответы Re: About to add WAL write/fsync statistics to pg_stat_wal view  (Li Japin <japinli@hotmail.com>)
Список pgsql-hackers
Hi,

I propose to add wal write/fsync statistics to pg_stat_wal view.
It's useful not only for developing/improving source code related to WAL
but also for users to detect workload changes, HW failure, and so on.

I introduce "track_wal_io_timing" parameter and provide the following 
information on pg_stat_wal view.
I separate the parameter from "track_io_timing" to "track_wal_io_timing"
because IIUC, WAL I/O activity may have a greater impact on query 
performance than database I/O activity.

```
postgres=# SELECT wal_write, wal_write_time, wal_sync, wal_sync_time 
FROM pg_stat_wal;
-[ RECORD 1 ]--+----
wal_write      | 650  # Total number of times WAL data was written to 
the disk

wal_write_time | 43   # Total amount of time that has been spent in the 
portion of WAL data was written to disk
                       # if track-wal-io-timing is enabled, otherwise 
zero

wal_sync       | 78   # Total number of times WAL data was synced to the 
disk

wal_sync_time  | 104  # Total amount of time that has been spent in the 
portion of WAL data was synced to disk
                       # if track-wal-io-timing is enabled, otherwise 
zero
```

What do you think?
Please let me know your comments.

Regards
-- 
Masahiro Ikeda
NTT DATA CORPORATION
Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Craig Ringer
Дата:
Сообщение: Re: Blocking I/O, async I/O and io_uring
Следующее
От: Kyotaro Horiguchi
Дата:
Сообщение: Re: [Patch] Optimize dropping of relation buffers using dlist