SLRU statistics

Поиск
Список
Период
Сортировка
Искать
От
Tomas Vondra
Тема
SLRU statistics
Дата
Msg-id
20200119143707.gyinppnigokesjok@development
Список
Дерево обсуждения
SLRU statistics Tomas Vondra <tomas.vondra@2ndquadrant.com>
RE: SLRU statistics "tsunakawa.takay@fujitsu.com" <tsunakawa.takay@fujitsu.com>
Re: SLRU statistics Tomas Vondra <tomas.vondra@2ndquadrant.com>
Re: SLRU statistics Alvaro Herrera <alvherre@2ndquadrant.com>
Re: SLRU statistics Tomas Vondra <tomas.vondra@2ndquadrant.com>
Re: SLRU statistics Masahiko Sawada <masahiko.sawada@2ndquadrant.com>
Re: SLRU statistics Tomas Vondra <tomas.vondra@2ndquadrant.com>
Re: SLRU statistics Alvaro Herrera <alvherre@2ndquadrant.com>
Re: SLRU statistics Tomas Vondra <tomas.vondra@2ndquadrant.com>
Re: SLRU statistics Alvaro Herrera <alvherre@2ndquadrant.com>
Re: SLRU statistics Tomas Vondra <tomas.vondra@2ndquadrant.com>
Re: SLRU statistics Tomas Vondra <tomas.vondra@2ndquadrant.com>
Re: SLRU statistics Tomas Vondra <tomas.vondra@2ndquadrant.com>
Re: SLRU statistics Tomas Vondra <tomas.vondra@2ndquadrant.com>
RE: SLRU statistics "Shinoda, Noriyoshi (PN Japan A&PS Delivery)"<noriyoshi.shinoda@hpe.com>
Re: SLRU statistics Tomas Vondra <tomas.vondra@2ndquadrant.com>
Re: SLRU statistics Kuntal Ghosh <kuntalghosh.2007@gmail.com>
Re: SLRU statistics Tomas Vondra <tomas.vondra@2ndquadrant.com>
Re: SLRU statistics Fujii Masao <masao.fujii@oss.nttdata.com>
Re: SLRU statistics Tomas Vondra <tomas.vondra@2ndquadrant.com>
Re: SLRU statistics Fujii Masao <masao.fujii@oss.nttdata.com>
Re: SLRU statistics Tomas Vondra <tomas.vondra@2ndquadrant.com>
Re: SLRU statistics Fujii Masao <masao.fujii@oss.nttdata.com>
Re: SLRU statistics Tomas Vondra <tomas.vondra@2ndquadrant.com>
Re: SLRU statistics Tomas Vondra <tomas.vondra@2ndquadrant.com>
Re: SLRU statistics Fujii Masao <masao.fujii@oss.nttdata.com>
Re: SLRU statistics Fujii Masao <masao.fujii@oss.nttdata.com>
Re: SLRU statistics Tomas Vondra <tomas.vondra@2ndquadrant.com>
Re: SLRU statistics Fujii Masao <masao.fujii@oss.nttdata.com>
Re: SLRU statistics Tom Lane <tgl@sss.pgh.pa.us>
Re: SLRU statistics Tomas Vondra <tomas.vondra@2ndquadrant.com>
Re: SLRU statistics Tom Lane <tgl@sss.pgh.pa.us>
Re: SLRU statistics Tomas Vondra <tomas.vondra@2ndquadrant.com>
Re: SLRU statistics Fujii Masao <masao.fujii@oss.nttdata.com>
Re: SLRU statistics Tomas Vondra <tomas.vondra@2ndquadrant.com>
Re: SLRU statistics Tom Lane <tgl@sss.pgh.pa.us>
Re: SLRU statistics Fujii Masao <masao.fujii@oss.nttdata.com>
Re: SLRU statistics Alvaro Herrera <alvherre@2ndquadrant.com>
Re: SLRU statistics Fujii Masao <masao.fujii@oss.nttdata.com>
Re: SLRU statistics Tom Lane <tgl@sss.pgh.pa.us>
Re: SLRU statistics Tom Lane <tgl@sss.pgh.pa.us>
Re: SLRU statistics Fujii Masao <masao.fujii@oss.nttdata.com>
Re: SLRU statistics Tom Lane <tgl@sss.pgh.pa.us>
Re: SLRU statistics Ranier Vilela <ranier.vf@gmail.com>
Re: SLRU statistics Fujii Masao <masao.fujii@oss.nttdata.com>
Re: SLRU statistics Robert Haas <robertmhaas@gmail.com>
Re: SLRU statistics Tom Lane <tgl@sss.pgh.pa.us>
RE: SLRU statistics "tsunakawa.takay@fujitsu.com" <tsunakawa.takay@fujitsu.com>
Re: SLRU statistics Tomas Vondra <tomas.vondra@2ndquadrant.com>
Hi,

One of the stats I occasionally wanted to know are stats for the SLRU
stats (we have couple of those - clog, subtrans, ...). So here is a WIP
version of a patch adding that.

The implementation is fairly simple - the slru code updates counters in
local memory, and then sends them to the collector at the end of the
transaction (similarly to table/func stats). The collector stores it
similarly to global stats. And the collected stats are accessible
through pg_stat_slru.

The main issue is that we have multiple SLRU caches, and it seems handy
to have separate stats for each. OTOH the number of SLRU stats is not
fixed, so e.g. extensions might define their own SLRU caches. But
handing dynamic number of SLRU caches seems a bit hard (we'd need to
assign some sort of unique IDs etc.) so what I did was define a fixed
number of SLRU types

     typedef enum SlruType
     {
         SLRU_CLOG,
         SLRU_COMMIT_TS,
         SLRU_MULTIXACT_OFFSET,
         SLRU_MULTIXACT_MEMBER,
         SLRU_SUBTRANS,
         SLRU_ASYNC,
         SLRU_OLDSERXID,
         SLRU_OTHER
     } SlruType;

with one group of counters for each group. The last type (SLRU_OTHER) is
used to store stats for all SLRUs that are not predefined. It wouldn't
be that difficult to store dynamic number of SLRUs, but I'm not sure how
to solve issues with identifying SLRUs etc. And there are probably very
few extensions adding custom SLRU anyway.

The one thing missing from the patch is a way to reset the SLRU stats,
similarly to how we can reset bgwriter stats.


regards

-- 
Tomas Vondra                  http://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
В списке pgsql-hackers по дате отправления
От: Heikki Linnakangas
Дата:
От: Justin Pryzby
Дата:
FAQ