pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Reseting statistics, cluster wide
8+ messages / 3 participants
[nested] [flat]

* Reseting statistics, cluster wide
@ 2011-04-20 19:31  Mario Splivalo <mario.splivalo@megafon.hr>
  0 siblings, 1 reply; 8+ messages in thread

From: Mario Splivalo @ 2011-04-20 19:31 UTC (permalink / raw)
  To: pgsql-admin

I have set up munin monitoring that plots nice graphs using 
pg_stat_bgwriter and pg_stat_database views. It has been on for quite 
some time now, and the numbers those views return are too big for munin 
to handle. I would like to reset those statistics. As explained by 
manual, pg_stat_reset() resets only db-related statistics, not the ones 
used cluster-wide. Is there a way to reset those? I don't mind stopping 
the server if I need to, but I'd realy like to have those started all 
over again.

	Mario



^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: Reseting statistics, cluster wide
@ 2011-04-20 20:49  raghu ram <raghuchennuru@gmail.com>
  parent: Mario Splivalo <mario.splivalo@megafon.hr>
  0 siblings, 1 reply; 8+ messages in thread

From: raghu ram @ 2011-04-20 20:49 UTC (permalink / raw)
  To: Mario Splivalo <mario.splivalo@megafon.hr>; +Cc: pgsql-admin

On Thu, Apr 21, 2011 at 1:01 AM, Mario Splivalo
<mario.splivalo@megafon.hr>wrote:

> I have set up munin monitoring that plots nice graphs using
> pg_stat_bgwriter and pg_stat_database views. It has been on for quite some
> time now, and the numbers those views return are too big for munin to
> handle. I would like to reset those statistics. As explained by manual,
> pg_stat_reset() resets only db-related statistics, not the ones used
> cluster-wide. Is there a way to reset those? I don't mind stopping the
> server if I need to, but I'd realy like to have those started all over
> again.
>


Currently we don't have such feature to reset statistics on cluster level.
You have to use two PostgreSQL functions like pg_stat_reset_shared(text),
pg_stat_reset ().


There are a few statistics that are only kept on a per-cluster basis, such
as those reported in pg_stat_database and pg_stat_bgwriter. Since
pg_stat_reset only resets per-database statistics.


psql=# select pg_stat_reset();


psql=# select pg_stat_reset_shared('bgwritter');  -- It will reset the
statistics shown by pg_stat_bgwritter.


--Raghu Ram




>
>        Mario
>
> --
> Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-admin
>

^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: Reseting statistics, cluster wide
@ 2011-04-21 07:51  Mario Splivalo <mario.splivalo@megafon.hr>
  parent: raghu ram <raghuchennuru@gmail.com>
  0 siblings, 1 reply; 8+ messages in thread

From: Mario Splivalo @ 2011-04-21 07:51 UTC (permalink / raw)
  To: pgsql-admin

On 04/20/2011 10:49 PM, raghu ram wrote:
> On Thu, Apr 21, 2011 at 1:01 AM, Mario Splivalo
> <mario.splivalo@megafon.hr <mailto:mario.splivalo@megafon.hr>> wrote:
>     I have set up munin monitoring that plots nice graphs using
>     pg_stat_bgwriter and pg_stat_database views. It has been on for
>     quite some time now, and the numbers those views return are too big
>     for munin to handle. I would like to reset those statistics. As
>     explained by manual, pg_stat_reset() resets only db-related
>     statistics, not the ones used cluster-wide. Is there a way to reset
>     those? I don't mind stopping the server if I need to, but I'd realy
>     like to have those started all over again.
> Currently we don't have such feature to reset statistics on cluster
> level. You have to use two PostgreSQL functions like
> pg_stat_reset_shared(text), pg_stat_reset ().
> There are a few statistics that are only kept on a per-cluster basis,
> such as those reported in pg_stat_database and pg_stat_bgwriter. Since
> pg_stat_reset only resets per-database statistics.
>
>
> psql=# select pg_stat_reset();
>
>
> psql=# select pg_stat_reset_shared('bgwritter');  -- It will reset the
> statistics shown by pg_stat_bgwritter.
>

Heh, I've neglected to mention that i'm using postgres 8.4.5 on Debian 
Stable. Is there a way to reset statistics on pg8.4? I've tested it on 
9.0 and it works there.

	Mario



^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: Reseting statistics, cluster wide
@ 2011-04-21 16:44  raghu ram <raghuchennuru@gmail.com>
  parent: Mario Splivalo <mario.splivalo@megafon.hr>
  0 siblings, 1 reply; 8+ messages in thread

From: raghu ram @ 2011-04-21 16:44 UTC (permalink / raw)
  To: Mario Splivalo <mario.splivalo@megafon.hr>; +Cc: pgsql-admin

>
>
> Heh, I've neglected to mention that i'm using postgres 8.4.5 on Debian
> Stable. Is there a way to reset statistics on pg8.4? I've tested it on 9.0
> and it works there.
>
>
>
AFAIK, I dont think we can achieve this in PG 8.4 at cluster level. Can
anybody has the information ?

-- Raghu

^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: Reseting statistics, cluster wide
@ 2011-04-22 13:20  Cédric Villemain <cedric.villemain.debian@gmail.com>
  parent: raghu ram <raghuchennuru@gmail.com>
  0 siblings, 1 reply; 8+ messages in thread

From: Cédric Villemain @ 2011-04-22 13:20 UTC (permalink / raw)
  To: raghu ram <raghuchennuru@gmail.com>; +Cc: Mario Splivalo <mario.splivalo@megafon.hr>; pgsql-admin

2011/4/21 raghu ram <raghuchennuru@gmail.com>:
>>
>> Heh, I've neglected to mention that i'm using postgres 8.4.5 on Debian
>> Stable. Is there a way to reset statistics on pg8.4? I've tested it on 9.0
>> and it works there.
>>
>
> AFAIK, I dont think we can achieve this in PG 8.4 at cluster level. Can
> anybody has the information ?
> -- Raghu

With 8.4 you only have the pg_stat_reset(), it resets all stats. The
finest one in 9.0 is a new feature/improvement.

See http://www.postgresql.org/docs/8.4/static/monitoring-stats.html

-- 
Cédric Villemain               2ndQuadrant
http://2ndQuadrant.fr/     PostgreSQL : Expertise, Formation et Support



^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: Reseting statistics, cluster wide
@ 2011-04-22 13:24  Mario Splivalo <mario.splivalo@megafon.hr>
  parent: Cédric Villemain <cedric.villemain.debian@gmail.com>
  0 siblings, 1 reply; 8+ messages in thread

From: Mario Splivalo @ 2011-04-22 13:24 UTC (permalink / raw)
  To: Cédric Villemain <cedric.villemain.debian@gmail.com>; +Cc: raghu ram <raghuchennuru@gmail.com>; pgsql-admin

On 04/22/2011 03:20 PM, Cédric Villemain wrote:
> 2011/4/21 raghu ram<raghuchennuru@gmail.com>:
>>>
>>> Heh, I've neglected to mention that i'm using postgres 8.4.5 on Debian
>>> Stable. Is there a way to reset statistics on pg8.4? I've tested it on 9.0
>>> and it works there.
>>>
>>
>> AFAIK, I dont think we can achieve this in PG 8.4 at cluster level. Can
>> anybody has the information ?
>> -- Raghu
>
> With 8.4 you only have the pg_stat_reset(), it resets all stats. The
> finest one in 9.0 is a new feature/improvement.

Yeps, but that is only for database-related statistics. Stuff returned 
from pg_stat_bgwriter view are not reset.

	Mario



^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: Reseting statistics, cluster wide
@ 2011-04-22 14:26  Cédric Villemain <cedric.villemain.debian@gmail.com>
  parent: Mario Splivalo <mario.splivalo@megafon.hr>
  0 siblings, 1 reply; 8+ messages in thread

From: Cédric Villemain @ 2011-04-22 14:26 UTC (permalink / raw)
  To: Mario Splivalo <mario.splivalo@megafon.hr>; +Cc: raghu ram <raghuchennuru@gmail.com>; pgsql-admin

2011/4/22 Mario Splivalo <mario.splivalo@megafon.hr>:
> On 04/22/2011 03:20 PM, Cédric Villemain wrote:
>>
>> 2011/4/21 raghu ram<raghuchennuru@gmail.com>:
>>>>
>>>> Heh, I've neglected to mention that i'm using postgres 8.4.5 on Debian
>>>> Stable. Is there a way to reset statistics on pg8.4? I've tested it on
>>>> 9.0
>>>> and it works there.
>>>>
>>>
>>> AFAIK, I dont think we can achieve this in PG 8.4 at cluster level. Can
>>> anybody has the information ?
>>> -- Raghu
>>
>> With 8.4 you only have the pg_stat_reset(), it resets all stats. The
>> finest one in 9.0 is a new feature/improvement.
>
> Yeps, but that is only for database-related statistics. Stuff returned from
> pg_stat_bgwriter view are not reset.

ah yes.
There exist a very brutal way to do it, which will remove all stats.
(you need the server to be down to do that)
move or rm the "global/pgstat.stat" file.

To come back to your original problem : I am surprised you have too
large value for munin, isn't there something to do on the munin side
instead ?

-- 
Cédric Villemain               2ndQuadrant
http://2ndQuadrant.fr/     PostgreSQL : Expertise, Formation et Support



^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: Reseting statistics, cluster wide
@ 2011-04-22 18:35  Mario Splivalo <mario.splivalo@megafon.hr>
  parent: Cédric Villemain <cedric.villemain.debian@gmail.com>
  0 siblings, 0 replies; 8+ messages in thread

From: Mario Splivalo @ 2011-04-22 18:35 UTC (permalink / raw)
  To: Cédric Villemain <cedric.villemain.debian@gmail.com>; +Cc: raghu ram <raghuchennuru@gmail.com>; pgsql-admin

On 04/22/2011 04:26 PM, Cédric Villemain wrote:
> ah yes.
> There exist a very brutal way to do it, which will remove all stats.
> (you need the server to be down to do that)
> move or rm the "global/pgstat.stat" file.
>
> To come back to your original problem : I am surprised you have too
> large value for munin, isn't there something to do on the munin side
> instead ?

I had some problems with munin that I've fixed now, it is plotting 
values quite ok :) But still, I wanted to see if there is a way to reset 
stats. Thnx :)

	Mario



^ permalink  raw  reply  [nested|flat] 8+ messages in thread


end of thread, other threads:[~2011-04-22 18:35 UTC | newest]

Thread overview: 8+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2011-04-20 19:31 Reseting statistics, cluster wide Mario Splivalo <mario.splivalo@megafon.hr>
2011-04-20 20:49 ` raghu ram <raghuchennuru@gmail.com>
2011-04-21 07:51   ` Mario Splivalo <mario.splivalo@megafon.hr>
2011-04-21 16:44     ` raghu ram <raghuchennuru@gmail.com>
2011-04-22 13:20       ` Cédric Villemain <cedric.villemain.debian@gmail.com>
2011-04-22 13:24         ` Mario Splivalo <mario.splivalo@megafon.hr>
2011-04-22 14:26           ` Cédric Villemain <cedric.villemain.debian@gmail.com>
2011-04-22 18:35             ` Mario Splivalo <mario.splivalo@megafon.hr>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox