Re: Using ProcSignal to get memory context stats from a running backend

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Using ProcSignal to get memory context stats from a running backend
Дата
Msg-id 30519.1513058791@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Using ProcSignal to get memory context stats from a runningbackend  (Andres Freund <andres@anarazel.de>)
Ответы Re: Using ProcSignal to get memory context stats from a running backend  (Craig Ringer <craig@2ndquadrant.com>)
Список pgsql-hackers
Andres Freund <andres@anarazel.de> writes:
> On 2017-12-12 11:57:41 +0800, Craig Ringer wrote:
>> TL;DR: Lets add a ProcSignalReason that makes a backend
>> call MemoryContextStats when it sees it and a C func that users can use to
>> set it on a proc. Sane?

> It's not unproblematic. procsignal_sigusr1_handler() runs in a signal
> handler, so you can't really rely on a lot of stuff being legal to do.

Indeed, calling MemoryContextStats in a signal handler would be a damfool
idea, but Craig didn't propose that AFAICS.

> Another question is whether printing to stderr, bypassing proper
> logging!, is good enough for something like this.

Yeah, this is an issue.  MemoryContextStats is designed to print
to stderr in the (possibly vain) hope that it will work even when
we are up against an OOM failure.  That's not a property I much
want to give up, but you're right that it's not very desirable
if a user is trying to capture state during normal running.

            regards, tom lane


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Dilip Kumar
Дата:
Сообщение: Re: Boolean partitions syntax
Следующее
От: Craig Ringer
Дата:
Сообщение: Re: Using ProcSignal to get memory context stats from a running backend