| From: | Jakub Wartak <jakub(dot)wartak(at)enterprisedb(dot)com> |
|---|---|
| To: | Quan Zongliang <quanzongliang(at)yeah(dot)net> |
| Cc: | PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org> |
| Subject: | Re: log_postmaster_stats |
| Date: | 2026-06-10 07:24:04 |
| Message-ID: | CAKZiRmzBZo7Ycm_f6z1+PEewmfaby9Tu=Jhm0TOYSa+nzjZmmA@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
On Wed, Jun 10, 2026 at 6:10 AM Quan Zongliang <quanzongliang(at)yeah(dot)net> wrote:
[..]
> When the database is idle for a long time. Will keep outputting
>
> LOG: postmaster stats: avg 0.00 conns/sec; 0.00 disconns/sec; 0.00
> parallel workers started/sec; CPU: user: ...
> LOG: postmaster stats: avg 0.00 conns/sec; 0.00 disconns/sec; 0.00
> parallel workers started/sec; CPU: user: ...
> LOG: postmaster stats: avg 0.00 conns/sec; 0.00 disconns/sec; 0.00
> parallel workers started/sec; CPU: user: ...
>
> Could it be considered to reduce the output frequency when conn_delta,
> disc_delta and pqw_delta are all zero?
> Or until a new connection is established, then output the log for the
> idle period at one time. Just like:
>
> LOG: postmaster stats: avg 0.00 conns/sec; 0.00 disconns/sec; 0.00
> parallel workers started/sec; CPU: user: 0.00 s, system: 0.00 s,
> elapsed: 1hours 10min 32s
> LOG: postmaster stats: avg 0.30 conns/sec; 0.20 disconns/sec; 1.10
> parallel workers started/sec; CPU: user: 0.00 s, system: 0.00 s,
> elapsed: 10.00 s
Hi Quan,
thanks for trying out the patch! To be honest, I don't have opinion on
this, we could do that if there's community agreement to do this (or
some committer wants it this way or that way), but right now e.g.
checkpoint_timeout (which serves similiar purpose) does not behave
like that and always logs stuff and I was been told we should do
things consistently.
As for reducing logs volume, I think one could just use threshold
of 1 or 10 minutes (but while assessing some production issues one
could bump it down to every 1s temporarily just to have data to have
much better understandind what was system/postmaster doing).
-J.
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Richard Guo | 2026-06-10 07:25:25 | Re: Reduce LEFT/FULL JOIN to ANTI JOIN in more cases |
| Previous Message | Amit Kapila | 2026-06-10 07:18:29 | Re: Proposal: Conflict log history table for Logical Replication |