Re: [Proposal] Add accumulated statistics
Adrien Nayrat <adrien.nayrat@anayrat.info>
From: Adrien NAYRAT <adrien.nayrat@anayrat.info>
To: "Tsunakawa, Takayuki" <tsunakawa.takay@jp.fujitsu.com>, "Yotsunaga, Naoki" <yotsunaga.naoki@jp.fujitsu.com>, 'Bruce Momjian' <bruce@momjian.us>, "'Phil
Florent'" <philflorent@hotmail.com>, 'Michael Paquier' <michael@paquier.xyz>, 'Tomas Vondra' <tomas.vondra@2ndquadrant.com>
Cc: "pgsql-hackers@lists.postgresql.org" <pgsql-hackers@lists.postgresql.org>
Date: 2019-01-07T13:43:07Z
Lists: pgsql-hackers
On 1/7/19 6:34 AM, Tsunakawa, Takayuki wrote: > 1. Doesn't provide precise data > Sampling could miss intermittent short waits, e.g., buffer content lock waits during checkpoints. This might make it difficult or impossible to solve transient performance problems, such as infrequent 100 millisecond response times while the normal response time is a few milliseconds. > The proposed wait event collection doesn't miss anything. > > 2. Overuses resources > We may be able to shorten the sampling interval to 10 ms or even 1 ms to detect short periods of problems. However, the sampled data of active sessions become voluminous in memory and storage. It would take longer to analyze those samples. Also, the background sampling process prevents the CPU core from becoming idle to save power, which bgwriter and walwriter tries to avoid by hibernation. > The proposed wait event collection just records what actually happened. No waste. Would it use many resources if waits happen frequently? That leads to our motivation to reduce waits. FIY, wait events have been added in PoWA by using pg_wait_sampling extension : https://rjuju.github.io/postgresql/2018/07/09/wait-events-support-for-powa.html pg_wait_sampling sample the wait events in shared memory and PoWA store them.