Re: postgres uptime - Mailing list pgsql-hackers

From Tom Lane
Subject Re: postgres uptime
Date
Msg-id 16688.1093048522@sss.pgh.pa.us
Whole thread Raw
In response to Re: postgres uptime  (Gaetano Mendola <mendola@bigfoot.com>)
Responses Re: postgres uptime  (Gaetano Mendola <mendola@bigfoot.com>)
List pgsql-hackers
Gaetano Mendola <mendola@bigfoot.com> writes:
>> I think we should just call gettimeofday() at postmaster start and store
>> it somewhere.

> Isn't the shared memory a good place ?

Depends.  Do you want to reset it during a backend-crash-recovery cycle?
You'll have to, if it's only stored in shared memory.  Depending on what
your definition of "uptime" is, that could be a reasonable thing to do,
or not.

There's been a remarkable lack of discussion about exactly what this
number would mean, anyway.  Does "postmaster start" mean postmaster
process start?  Or when we are first ready to receive a connection?
There could be a *very* large difference, in the case of a hot-standby
postmaster.
        regards, tom lane


pgsql-hackers by date:

Previous
From: "Joshua D. Drake"
Date:
Subject: Re: devx article
Next
From: Tom Lane
Date:
Subject: Re: devx article