From: | Alexander Korotkov <aekorotkov(at)gmail(dot)com> |
---|---|
To: | Ildus Kurbangaliev <i(dot)kurbangaliev(at)postgrespro(dot)ru> |
Cc: | Robert Haas <robertmhaas(at)gmail(dot)com>, Heikki Linnakangas <hlinnaka(at)iki(dot)fi>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, "andres(at)anarazel(dot)de" <andres(at)anarazel(dot)de>, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com> |
Subject: | Re: RFC: replace pg_stat_activity.waiting with something more descriptive |
Date: | 2015-08-14 13:53:02 |
Message-ID: | CAPpHfdvDJzZDA8P7pxVFFKwv8995CjP5z10C8GgDM+Mtq10kAw@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Thu, Aug 6, 2015 at 1:01 PM, Ildus Kurbangaliev <
i(dot)kurbangaliev(at)postgrespro(dot)ru> wrote:
> On 08/05/2015 09:33 PM, Robert Haas wrote:
>
>> On Wed, Aug 5, 2015 at 1:10 PM, Ildus Kurbangaliev
>> <i(dot)kurbangaliev(at)postgrespro(dot)ru> wrote:
>>
>>> About `memcpy`, PgBackendStatus struct already have a bunch of multi-byte
>>> variables, so it will be
>>> not consistent anyway if somebody will want to copy it in that way. On
>>> the
>>> other hand two bytes in this case
>>> give less overhead because we can avoid the offset calculations. And as
>>> I've
>>> mentioned before the class
>>> of wait will be useful when monitoring of waits will be extended.
>>>
>> You're missing the point. Those multi-byte fields have additional
>> synchronization requirements, as I explained in some detail in my
>> previous email. You can't just wave that away.
>>
> I see that now. Thank you for the point.
>
> I've looked deeper and I found PgBackendStatus to be not a suitable
> place for keeping information about low level waits. Really,
> PgBackendStatus
> is used to track high level information about backend. This is why
> auxiliary
> processes don't have PgBackendStatus, because they don't have such
> information
> to expose. But when we come to the low level wait events then auxiliary
> processes are as useful for monitoring as backends are. WAL writer,
> checkpointer, bgwriter etc are using LWLocks as well. This is certainly
> unclear
> why they can't be monitored.
>
> This is why I think we shoudn't place wait event into PgBackendStatus. It
> could be placed into PGPROC or even separate data structure with different
> concurrency model which would be most suitable for monitoring.
+1 for tracking wait events not only for backends
Ildus, could you do following?
1) Extract LWLocks refactoring into separate patch.
2) Make a patch with storing current wait event information in PGPROC.
------
Alexander Korotkov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2015-08-14 14:11:34 | Re: RFC: replace pg_stat_activity.waiting with something more descriptive |
Previous Message | Robert Haas | 2015-08-14 13:33:40 | why can the isolation tester handle only one waiting process? |