Re: Enhancing Memory Context Statistics Reporting
Alvaro Herrera <alvherre@alvh.no-ip.org>
From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: Rahila Syed <rahilasyed90@gmail.com>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2024-10-26T14:14:25Z
Lists: pgsql-hackers
On 2024-Oct-21, Rahila Syed wrote: > I propose enhancing memory context statistics reporting by combining > these capabilities and offering a view of memory statistics for all > PostgreSQL backends and auxiliary processes. Sounds good. > A fixed-size shared memory block, currently accommodating 30 records, > is used to store the statistics. Hmm, would it make sene to use dynamic shared memory for this? The publishing backend could dsm_create one DSM chunk of the exact size that it needs, pass the dsm_handle to the consumer, and then have it be destroy once it's been read. That way you don't have to define an arbitrary limit of any size. (Maybe you could keep a limit to how much is published in shared memory and spill the rest to disk, but I think such a limit should be very high[1], so that it's unlikely to take effect in normal cases.) [1] This is very arbitrary of course, but 1 MB gives enough room for some 7000 contexts, which should cover normal cases. -- Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/ "Find a bug in a program, and fix it, and the program will work today. Show the program how to find and fix a bug, and the program will work forever" (Oliver Silfridge)
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Cross-check lists of built-in LWLock tranches.
- 2047ad068139 19 (unreleased) cited
-
Convert strncpy to strlcpy
- 45e7e8ca9e93 18.0 landed
-
Typo and doc fixups for memory context reporting
- f8c115a6cb65 18.0 landed
-
Add missing string terminator
- d2a1ed1727a8 18.0 landed
-
Rename argument in pg_get_process_memory_contexts().
- c57971034e69 18.0 landed
-
Add function to get memory context stats for processes
- 042a66291b04 18.0 landed