Re: Report distinct wait events when waiting for WAL "operation"

From: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Report distinct wait events when waiting for WAL "operation"
Date: 2023-07-19 13:19:57
Message-ID: CAA4eK1Ktxtz3LkfhqwasczKQTv=BMwQLy9TNJgcpkRGchvouHw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Jul 17, 2023 at 10:26 PM Andres Freund <andres(at)anarazel(dot)de> wrote:
>
> Previously it was e.g. not really possible to distinguish that something like
> this:
>
> ┌────────────────┬─────────────────┬────────────┬───────┐
> │ backend_type │ wait_event_type │ wait_event │ count │
> ├────────────────┼─────────────────┼────────────┼───────┤
> │ client backend │ LWLock │ WALInsert │ 32 │
> │ client backend │ (null) │ (null) │ 9 │
> │ walwriter │ IO │ WALWrite │ 1 │
> │ client backend │ Client │ ClientRead │ 1 │
> │ client backend │ LWLock │ WALWrite │ 1 │
> └────────────────┴─────────────────┴────────────┴───────┘
>
> is a workload with a very different bottleneck than this:
>
> ┌────────────────┬─────────────────┬───────────────┬───────┐
> │ backend_type │ wait_event_type │ wait_event │ count │
> ├────────────────┼─────────────────┼───────────────┼───────┤
> │ client backend │ IPC │ WALWaitInsert │ 22 │
> │ client backend │ LWLock │ WALInsert │ 13 │
> │ client backend │ LWLock │ WALBufMapping │ 5 │
> │ walwriter │ (null) │ (null) │ 1 │
> │ client backend │ Client │ ClientRead │ 1 │
> │ client backend │ (null) │ (null) │ 1 │
> └────────────────┴─────────────────┴───────────────┴───────┘
>
> even though they are very different
>
> FWIW, the former is bottlenecked by the number of WAL insertion locks, the
> second is bottlenecked by copying WAL into buffers due to needing to flush
> them.
>

This gives a better idea of what's going on. +1 for separating these waits.

--
With Regards,
Amit Kapila.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message 赵锐 (惜元) 2023-07-19 13:31:35 pg_rewind fails with in-place tablespace
Previous Message Thom Brown 2023-07-19 13:13:41 Re: Disabling Heap-Only Tuples