Re: Add per-backend AIO statistics

From: solai v <solai(dot)cdac(at)gmail(dot)com>
To: Bertrand Drouvot <bertranddrouvot(dot)pg(at)gmail(dot)com>
Cc: Andres Freund <andres(at)anarazel(dot)de>, Michael Paquier <michael(at)paquier(dot)xyz>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Add per-backend AIO statistics
Date: 2026-07-30 11:44:29
Message-ID: CAF0whufYfeLqsUy+UOoiYZgLpsPEYfXJm=qNocL-k69-yQbczw@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

I tested the patch "v1-0001-Add-per-backend-AIO-statistics.patch".
The patch applied cleanly without conflicts. I rebuilt PostgreSQL,
installed the patched binaries, initialized a fresh cluster using
initdb, and verified that the new function pg_stat_get_backend_aio()
was successfully added and available.
For functional testing, I first queried the new function before
generating any workload:
started = 74
executed_sync = 73
executed_async = 1
completed_self = 73
completed_other = 0
handle_waits = 0
submitted = 1

To generate AIO activity, I created a table with 1,000,000 rows, ran
ANALYZE, and executed SELECT COUNT(*) on the table. After the
workload, I queried pg_stat_get_backend_aio(pg_backend_pid()) again
and observed:
started = 26632
executed_sync = 137
executed_async = 26495
completed_self = 224
completed_other = 0
handle_waits = 0
submitted = 26480

The results show a significant increase in the started,
executed_async, and submitted counters after the workload, which is
consistent with the expected increase in asynchronous I/O activity.
The completed_other and handle_waits counters remained at zero during
my testing, which was expected for this workload.
Overall, the new function returned the expected per-backend AIO
statistics, and the observed values reflected the generated workload.
I did not encounter any build or functional issues while testing the
patch.

Regards
Solai

In response to

Browse pgsql-hackers by date

  From Date Subject
Previous Message Ranier Vilela 2026-07-30 11:20:53 Re: lazy_scan_heap: avoid vacuum block, already vacuumed (src/backend/access/heap/vacuumlazy.c)