percona / percona/pg_stat_monitor

Monitor/expose utilization of shared memory (pgsm_max)

Open
#466 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Perl
Stars
591
Forks
73
Avg merge
2d 13h
Merged PRs (30d)
13

Description

Description

Hi, we would like to monitor the level of utilization of the shared memory allocated by the extension so we can know if pgsm_max needs to be increased or not. I couldn't find any reference for right-sizing the amount of shared memory given the query load or other factors, so we'd like to right-size it through monitoring the usage as a percentage of pgsm_max and increasing it if necessary.

Thank you.

Suggested solution

Provide a function that returns the memory usage by all the buckets in bytes, which could be compared to pgsm_max.

Additional context

We are currently using postgresql 12.

Happy to try to contribute this to the code if someone could give me a pointer about where I could start looking.

Code of Conduct
  • I agree to follow this project's Code of Conduct

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names pgsm_max and requests a function reporting shared-memory usage across all buckets in bytes. Start by tracing where pgsm_max and the extension's shared-memory buckets are defined; done means the reported usage can be compared with pgsm_max to monitor utilization.

Written by the indexing model from the issue text.

Assessment

Tech stack
postgresql
Domain
databases
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.