Skip to content

Calculating size of database can cause performance issues #1150

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

Open
plaffitt opened this issue Apr 10, 2025 · 0 comments
Open

Calculating size of database can cause performance issues #1150

plaffitt opened this issue Apr 10, 2025 · 0 comments

Comments

@plaffitt
Copy link

plaffitt commented Apr 10, 2025

What did you do?

We operate a postgres cluster for a client that have thousands of databases.

postgres=# select count(*) from pg_database ;
 count
-------
  7771
(1 row)

Calculating the size of each database every time we poll the metrics cause serious performance issues and a filesystem overhead since this calculation is done by summing the size of each individual files of the database.

What did you expect to see?

We would like an option to disable metrics that relies on tasks that are purely related to the operating system and thus produce a lot of syscalls and especially fs/disk related ones that are slow by nature. In my understanding it would only affect the pgDatabaseSize metric, so maybe we just need an option to specifically disable this one.

What did you see instead? Under which circumstances?

I didn't find any option to disable a specific metric, especially the pgDatabaseSize metric.

Environment

Not relevant in this case IMHO.

PS: I would be happy to work on a pull request to add such an option if you're open to it.

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

No branches or pull requests

1 participant