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
[Bug]: Incorrect bloat calculation in go.d.plugin, postgres module #17593
Comments
PS PostgreSQL version:
|
@cuu508, hey 👋 While go.d.plugin gathers data every |
In my case, the dashboard was showing the outdated value for hours (and a warning was active too) . Also, running the bloat calculation query manually did not return the calculated bloat value for that specific index at all (the row was absent). In summary:
|
@cuu508 I understood that, thanks! I think I fixed it in #17598
Netdata uses bloat query from bucardo/check_postgres. I am not a Postgres expert, so I can't say which query is better/more correct. |
Ah, sorry, I missed the referenced commit! I compared bucardo's and netdata's bloat calculation queries. They are identical except the netdata version has at the very end:
I think this is the bit responsible for netdata missing bloat data for some of my indexes. I have one particular index for which bucardo's query calculates ibloat as 0.5:
But since ipages is lower than iotta, it is omitted from the netdata version. The other query calculates the bloat as 43% for this same index. (edit:) but some of the calculated bloat values looked wacky, -247% and such. In the bucardo query at least all ibloat values were zero or positive) |
@cuu508 bucardos query has this otta/iotta limit (a bit bigger) ## Don't bother with tables or indexes unless they have at least this many bloated pages
my $MINPAGES = 10;
my $MINIPAGES = 15; See: |
Bug description
I'm monitoring a postgres database with netdata. Netdata reports a particular index as having high bloat (above 70%, which triggers a warning, which is how I noticed). Looking into it, it appears as if netdata is stuck reporting a high value:
If I manually run the query from
netdata/src/go/collectors/go.d.plugin/modules/postgres/queries.go
Line 641 in fae323e
If I check index bloat using another query from here, it reports index bloat as 21% for the specific index.
I suspect that:
Expected behavior
Steps to reproduce
...
Installation method
manual setup of official DEB/RPM packages
System info
Netdata build info
Additional info
No response
The text was updated successfully, but these errors were encountered: