Skip to content

[GSoC] Add missing IO instrumentation for Server Logging (Observer Effect)#15

Open
shinsj4653 wants to merge 1 commit intoNikolayS:claude/cpu-asterisk-wait-events-01CyiYYMMcFMovuqPqLNcp8Tfrom
shinsj4653:patch-1
Open

[GSoC] Add missing IO instrumentation for Server Logging (Observer Effect)#15
shinsj4653 wants to merge 1 commit intoNikolayS:claude/cpu-asterisk-wait-events-01CyiYYMMcFMovuqPqLNcp8Tfrom
shinsj4653:patch-1

Conversation

@shinsj4653
Copy link

@shinsj4653 shinsj4653 commented Feb 21, 2026

🚀 Added & Resolved: Logging Observer Effect (Uninstrumented I/O)

Hi @NikolayS,

Following up on your suggestion to investigate the "Observer Effect" during heavy logging, I noticed this specific gap wasn't documented in the current WAIT_EVENTS_ANALYSIS.md.

What I did:

  1. Reproduced the issue: Under high logging volume (log_statement='all', logging_collector=on), backend processes hit significant I/O bottlenecks on write() system calls. Due to the lack of instrumentation, this appeared as wait_event IS NULL in pg_stat_activity, disguising I/O waits as active CPU time.
  2. Created a PoC Patch: I added the WaitEventIO:LogFileWrite event and instrumented the write_pipe_chunks and write_console functions in elog.c.
  3. Updated this Document: I added the new 1.5 Server Logging Operations section to your analysis and marked it as resolved.

I will send the actual .patch file and the proof screenshot (showing the newly added LogFileWrite event in action) to the gsoc-mentors mailing list so you and Kirk can review the code.

image

Documents the "Observer Effect" occurring during heavy logging scenarios where uninstrumented write() calls to stderr or the syslogger pipe cause backends to appear as consuming CPU (wait_event IS NULL).

- Added section 1.5 to track this missing instrumentation in elog.c (write_console and write_pipe_chunks).
- Marked as resolved, as a PoC patch introducing WaitEventIO:LogFileWrite has been developed and submitted to the mentors.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant