pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Josh Kupershmidt <schmiddy@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Chris <lists@deksai.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: stats collector suddenly causing lots of IO
Date: Fri, 16 Apr 2010 10:39:07 -0400
Message-ID: <z2s4ec1cf761004160739w3ac5511jd39263dd043e2da6@mail.gmail.com> (raw)
In-Reply-To: <25952.1271370711@sss.pgh.pa.us>
References: <20100413170105.GA29571@chris-laptop.a2hosting.com>
	<25952.1271370711@sss.pgh.pa.us>

On Thu, Apr 15, 2010 at 6:31 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Chris <lists@deksai.com> writes:
>> I have a lot of centos servers which are running postgres.  Postgres isn't used
>> that heavily on any of them, but lately, the stats collector process keeps
>> causing tons of IO load.  It seems to happen only on servers with centos 5.
>
> Say, I just realized that both of you are complaining about stats
> collector overhead on centos 5 servers.  I hadn't been thinking in terms
> of OS-specific causes, but maybe that is what we need to consider.
> Can you tell me the exact kernel versions you are seeing these problems
> with?

uname -a says "... 2.6.18-92.1.13.el5 #1 SMP ... x86_64", and it's CentOS 5.2.

I'm not sure whether this is related to the stats collector problems
on this machine, but I noticed alarming table bloat in the catalog
tables pg_attribute, pg_attrdef, pg_depend, and pg_type. Perhaps this
has happened slowly over the past few months, but I discovered the
bloat when I ran the query from:
http://pgsql.tapoueh.org/site/html/news/20080131.bloat.html

on the most-active database on this server (OID 16389 from the
pgstat.stat I sent in). See attached table_bloat.txt. The autovacuum
settings for this server haven't been tweaked from the default; they
probably should have been, given the heavy bulk updates/inserts done.
Maybe there's another cause for this extreme catalog bloat, besides
the weak autovacuum settings, though.

Table sizes, according to pg_size_pretty(pg_total_relation_size(...)):
 * pg_attribute: 145 GB
 * pg_attrdef: 85 GB
 * pg_depend: 38 GB
 * pg_type: 3465 MB

I'll try to send in strace outputs later today.

Josh

Attachments:

table_bloat.txt (text/plain, 2.5K) download schemaname | tablename | reltuples | relpages | otta | tbloat | wastedpages | wastedbytes | wastedsize | iname | ituples | ipages | iotta | ibloat | wastedipages | wastedibytes | wastedisize ---------------+-----------------------+-----------+----------+--------+----------+-------------+-------------+------------+------------------------------------------------+----------+---------+--------+---------+--------------+--------------+------------- pg_catalog | pg_attribute | 0 | 12178069 | 0 | 0.0 | 12178069 | 99762741248 | 93 GB | pg_attribute_relid_attnam_index | 0 | 4525199 | 0 | 0.0 | 4525199 | 37070430208 | 35 GB pg_catalog | pg_attribute | 0 | 12178069 | 0 | 0.0 | 12178069 | 99762741248 | 93 GB | pg_attribute_relid_attnum_index | 0 | 848842 | 0 | 0.0 | 848842 | 6953713664 | 6632 MB pg_catalog | pg_attrdef | 767 | 8789472 | 30 | 292982.4 | 8789442 | 72003108864 | 67 GB | pg_attrdef_oid_index | 767 | 361513 | 28 | 12911.2 | 361485 | 2961285120 | 2824 MB pg_catalog | pg_attrdef | 767 | 8789472 | 30 | 292982.4 | 8789442 | 72003108864 | 67 GB | pg_attrdef_adrelid_adnum_index | 767 | 359805 | 28 | 12850.2 | 359777 | 2947293184 | 2811 MB <snip one bloated user table> pg_catalog | pg_depend | 14270 | 1890691 | 98 | 19292.8 | 1890593 | 15487737856 | 14 GB | pg_depend_depender_index | 14270 | 1649557 | 65 | 25377.8 | 1649492 | 13512638464 | 13 GB pg_catalog | pg_depend | 14270 | 1890691 | 98 | 19292.8 | 1890593 | 15487737856 | 14 GB | pg_depend_reference_index | 14270 | 1371522 | 65 | 21100.3 | 1371457 | 11234975744 | 10 GB <snip some more user tables> pg_catalog | pg_type | 1333 | 385445 | 31 | 12433.7 | 385414 | 3157311488 | 3011 MB | pg_type_oid_index | 1333 | 54965 | 24 | 2290.2 | 54941 | 450076672 | 429 MB pg_catalog | pg_type | 1333 | 385445 | 31 | 12433.7 | 385414 | 3157311488 | 3011 MB | pg_type_typname_nsp_index | 1333 | 3129 | 24 | 130.4 | 3105 | 25436160 | 24 MB <snip>

view thread (22+ messages)  latest in thread

Message-ID: <z2s4ec1cf761004160739w3ac5511jd39263dd043e2da6@mail.gmail.com>
Permalink:  ../z2s4ec1cf761004160739w3ac5511jd39263dd043e2da6@mail.gmail.com/
Also on:    postgresql.org/message-id/z2s4ec1cf761004160739w3ac5511jd39263dd043e2da6@mail.gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-performance@postgresql.org
  Cc: schmiddy@gmail.com, tgl@sss.pgh.pa.us, lists@deksai.com
  Subject: Re: stats collector suddenly causing lots of IO
  In-Reply-To: <z2s4ec1cf761004160739w3ac5511jd39263dd043e2da6@mail.gmail.com>
  References: <20100413170105.GA29571@chris-laptop.a2hosting.com> <25952.1271370711@sss.pgh.pa.us> <z2s4ec1cf761004160739w3ac5511jd39263dd043e2da6@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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