Re: Add progressive backoff to XactLockTableWait functions

From: Xuneng Zhou <xunengzhou(at)gmail(dot)com>
To: Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com>
Cc: Kevin K Biju <kevinkbiju(at)gmail(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Add progressive backoff to XactLockTableWait functions
Date: 2025-06-17 14:02:49
Message-ID: CABPTF7XTPPOWqo6yT3jbKr0dsGSKGR0FdXt7yGtEpZR==+f7sA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On Tue, Jun 17, 2025 at 9:38 PM Xuneng Zhou <xunengzhou(at)gmail(dot)com> wrote:

> Hi,
>
> Although it’s clear that replacing tight 1 ms polling loops will reduce
> CPU usage, I'm curious about the hard numbers. To that end, I ran a 60 s
> logical-replication slot–creation workload on a standby using three
> different XactLockTableWait() variants—on an 8-core, 16 GB AMD system—and
> collected both profiling traces and hardware-counter metrics.
>
>
> 1. Hardware‐counter results
>
>
> [image: image.png]
>
>
> - CPU cycles drop by 58% moving from 1 ms to exp. backoff, and another
> 25% to the 1 s threshold variant.
> - Cache‐misses and context‐switches see similarly large reductions.
> - IPC remains around 0.45, dipping slightly under longer sleeps.
>
>
Gmail does not seem to support embedded images, so I’ve included it as an
attachment.

Best regards,

Xuneng

Attachment Content-Type Size
hardware_counter_results.png image/png 81.9 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Fujii Masao 2025-06-17 14:03:47 Re: Avoid possible dereference null pointer (contrib/postgres_fdw/postgres_fdw.c)
Previous Message Ranier Vilela 2025-06-17 13:54:45 Re: Fix copy-and-past thinko (src/interfaces/libpq/fe-cancel.c)