[check_postgres] Issue with check_postgres bloat check.

Jehan-Guillaume de Rorthais jgdr at dalibo.com
Tue Nov 3 21:52:45 UTC 2015


On Tue, 3 Nov 2015 16:46:03 -0500
"Shaik, Baji" <baji.shaik at openscg.com> wrote:

> >
> >
> > I'm not sure to understand. If the table have half bloat, do you mean the
> > reported bloat should be 100% ?
> >
> 
> No. Let me try to explain what I see. First case, I have a table with 120M
> where 90M is actual size and 30M is the bloat. So table is bloated to 25%.
> When I set bloat percent to 50%, still it throws alert as table size is
> 1.2X. I understand that this 1.2 ratio comes when you compare to actual
> size to expected size.

mkay, agree. I don't know why check_postgres throw an alert in this situation.

> Now second case, I have a table with 120M where 60M is actual size and 60M
> is the bloat. So the table is 50% bloat. Now the ratio comes to 1.5X and
> throws the alert. 

Well, it should be 2x, not 1.5x.

> It makes sense for setting of 50% bloat as threshold.
> 
> But why is it throwing alert for first case?

Maybe a bug ?

Give check_pga a try, I'm curious.

> > > However I am still confused on if I am missing something.
> >
> > It sounds to me you are not missing something...
> >
> > > > > On Tue, Oct 27, 2015 at 5:23 AM, Jehan-Guillaume de Rorthais <
> > > > > jgdr at dalibo.com> wrote:
> > > > >
> > > > > > On Fri, 16 Oct 2015 20:11:24 +0530
> > > > > > "Shaik, Baji" <baji.shaik at openscg.com> wrote:
> > > > > >
> > > > > > > Hi Team,
> > > > > >
> > > > > > Hi,
> > > > > >
> > > > > > > I have configured bloat_check for 50% of the table as WARNING,
> > > > however
> > > > > > even
> > > > > > > if tables is bloated less than the percentage configured, it is
> > > > throwing
> > > > > > an
> > > > > > > alert. If you see below example, ONLY 30% of the table is
> > bloated,
> > > > > > however
> > > > > > > still I can see the table in the bloated list with 50% as
> > critical
> > > > > > > threshold.
> > > > > > >
> > > > > > > Kindly let me know if I am missing anything.
> > > > > > >
> > > > > > > bloat_test=# \dt+ t
> > > > > > >                      List of relations
> > > > > > >  Schema | Name | Type  |    Owner     | Size  | Description
> > > > > > > --------+------+-------+--------------+-------+-------------
> > > > > > >  public | t    | table | enterprisedb | 69 MB |
> > > > > > > (1 row)
> > > > > > >
> > > > > > > bloat_test=# \q
> > > > > > > root at ubuntu:/home/bajishaik/check_postgres-2.22.0#
> > > > > > ./check_postgres_bloat
> > > > > > > --port=5445 --critical='500%' --db='bloat_test'
> > > > --dbuser='enterprisedb'
> > > > > > > POSTGRES_BLOAT OK: DB "bloat_test" (port=5445) (db bloat_test)
> > table
> > > > > > > public.t rows:1500001 pages:8850 shouldbe:6608 (1.3X) wasted
> > > > > > size:18366464
> > > > > > > (17 MB) | public.t=18366464B
> > > > > > > root at ubuntu:/home/bajishaik/check_postgres-2.22.0#
> > > > > > > root at ubuntu:/home/bajishaik/check_postgres-2.22.0#
> > > > > > > root at ubuntu:/home/bajishaik/check_postgres-2.22.0#
> > > > > > ./check_postgres_bloat
> > > > > > > --port=5445 --critical='50%' --db='bloat_test'
> > > > --dbuser='enterprisedb'
> > > > > > > POSTGRES_BLOAT CRITICAL: DB "bloat_test" (port=5445) (db
> > bloat_test)
> > > > > > table
> > > > > > > public.t rows:1500001 pages:8850 shouldbe:6608 (1.3X) wasted
> > > > > > size:18366464
> > > > > > > (17 MB) | public.t=18366464B
> > > > > >
> > > > > > I see you are using entreprisedb ? Could you have a look at
> > > > > > check_pgactivity by
> > > > > > any chance and tell me if it is compatible ? :-)
> > > > > >
> > > > > > See:
> > > > > >
> > > > > >
> > > >
> > https://exchange.nagios.org/directory/Plugins/Databases/PostgresQL/check_pgactivity/details

-- 
Jehan-Guillaume de Rorthais
Dalibo
http://www.dalibo.com


More information about the Check_postgres mailing list