~/talk

Designing and implementing a monitoring feature in PostgreSQL

Talkat PGConf.dev 2025 · 2025-05-13..05-16· [databases]
linkedin:rahila-syed
slides:none on file

New core PostgreSQL feature (committed for PostgreSQL 18) implements on‑demand memory‑context dumps using dynamic shared memory: a coordinating backend creates a DSA (dynamic shared area) via DSA allocate/DSA free, target processes attach via DSM handles, copy their tree of memory contexts into the DSA, then wake the waiter using LW locks and condition variables. Exposed as PG_get_process_memory_context(pid, get_summary, timeout), supports summary mode to reduce size, configurable timeout, and measured tradeoffs between response latency and extra memory use.

AI-written summary · about

  1. 0:00Introduction to PostgreSQL monitoring
  2. 1:17Types of PostgreSQL statistics
  3. 3:52Designing monitoring features
  4. 6:24Memory context basics
  5. 8:55Need for memory context stats
  6. 10:19Implementation of monitoring function
  7. 11:27Dynamic shared memory framework
  8. 13:37Dynamic shared area (DSA)
  9. 16:47Shared memory structure
  10. 18:55Data flow in monitoring function
  11. 21:45Synchronization primitives
  12. 22:29Dynamic vs static memory
  13. 24:15Handling large statistics
  14. 25:02Function API and output
  15. 28:31Customizing memory context output
  16. 29:17Future API for on-demand stats
  17. 31:28Summary and Q&A
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.