Re: Function to track shmem reinit time - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Function to track shmem reinit time
Date
Msg-id 6526.1520179791@sss.pgh.pa.us
Whole thread Raw
In response to Re: Function to track shmem reinit time  (Tomas Vondra <tomas.vondra@2ndquadrant.com>)
List pgsql-hackers
Tomas Vondra <tomas.vondra@2ndquadrant.com> writes:
> On 02/28/2018 02:39 PM, Grigory Smolkin wrote:
>> It can be used to accurately calculate server uptime, since you can`t
>> rely on pg_postmaster_start_time() in this.

> Can you please explain why pg_postmaster_start_time can't be used for
> this purpose? It seems like a pretty good match, considering it's meant
> to show server start time.

It evidently depends on how you want to define "server uptime".  If you
get backend crashes often enough, you might feel a need to define it
as "time since last crash".  Although I would think that if that's
happening regularly in a production environment, you have a problem
you need to fix, not just measure.

My own thought about that is that if you are trying to measure
backend crashes, just knowing the time of the latest one is little help.
You want to know how often they're happening.  So this gets back to the
question of why the postmaster log isn't a useful source of that
information.  I think that if we're to do anything in this area,
improving the usefulness of the log would be more important than
providing the proposed function.

            regards, tom lane


pgsql-hackers by date:

Previous
From: Tomas Vondra
Date:
Subject: Re: Function to track shmem reinit time
Next
From: Tomas Vondra
Date:
Subject: Re: Function to track shmem reinit time