Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Aggregate pgbouncer statistics values by database #101

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Talkless
Copy link

PGBouncer checks does not take into account possibility when multiple different database users are connected into same database (pool).

Here's our SHOW pools example:
http://pastebin.com/raw/4ybsQCRE

Meanwhile, check_postgres output is like this:

POSTGRES_PGB_POOL_MAXWAIT OK: DB "pgbouncer" (port=6434) ourdb=0 * ourdb=0 * ourdb=0 * ourdb=0 * ourdb=0 * ourdb=0 * ourdb=0 * ourdb=0 * ourdb=0 * ourdb=0 * ourdb=0 * ourdb=0 * ourdb=0 * ourdb=0 * ourdb=0 * ourdb=0 * ourdb=0 * ourdb=0 * ourdb=0 * ourdb=0 * ourdb=0 * ourdb=0 * ourdb=0 * ourdb=0 * ourdb=0 * ourdb=0 * ourdb=0 * ourdb=0 * ourdb=0 * ourdb=0 * ourdb=0 * ourdb=0 * ourdb=0 * ourdb=0 * ourdb=0 * ourdb=0 * ourdb=0 * ourdb=0 * ourdb=0 * ourdb=0 * ourdb=0 * ourdb=0 * ourdb=0 * ourdb=0 * ourdb=0 * ourdb=0 * ourdb=0 * ourdb=0 * ourdb=0 * ourdb=0 * ourdb=0 * ourdb=0 * ourdb=0 * ourdb=0 * ourdb=0 * ourdb=0 * ourdb=0 * ourdb=0 * ourdb=0 * ourdb=0 * ourdb=0 * ourdb=0 * ourdb=0 * ourdb=0 * ourdb=0 * ourdb=0 * ourdb=0 * ourdb=0 * ourdb=0 * ourdb=0 * ourdb=0 * ourdb=0 * ourdb=0 * ourdb=0 * ourdb=0 * ourdb=0 * ourdb=0 * ourdb=0 * ourdb=0 * ourdb=0 * ourdb=0 * ourdb=0 * ourdb=0 * ourdb=0 * ourdb=0 * ourdb=0 * ourdb=0 * ourdb=0 * ourdb=0 * pgbouncer=0

I've fixed it by implementing sum and max (for maxwait) aggregation.

After fix output is like this:

POSTGRES_PGB_POOL_MAXWAIT OK: DB "pgbouncer" (port=6433) pgbouncer=0 * ourdb=0 

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