From: Greg Smith <greg@2ndquadrant.com>
To: Campbell, Lance <lance@illinois.edu>
Cc: pgsql-performance@postgresql.org
Subject: Re: How much memory is PostgreSQL using
Date: Mon, 29 Mar 2010 12:53:33 -0400
Message-ID: <4BB0DB0D.80208@2ndquadrant.com> (raw)
In-Reply-To: <B10E6810AC2A2F4EA7550D072CDE876004B2E218@SAB-FENWICK.sab.uiuc.edu>
References: <B10E6810AC2A2F4EA7550D072CDE876004B2E218@SAB-FENWICK.sab.uiuc.edu>
Campbell, Lance wrote:
>
> Or is there some way to ask PostgreSQL how much memory are you using
> to cache disk blocks currently?
>
You can install contrib/pg_buffercache into each database and count how
many used blocks are there. Note that running queries using that
diagnostic tool is really intensive due to the locks it takes, so be
careful not to do that often on a production system.
> When you do a PG_DUMP does PostgreSQL put the disk blocks into shared
> buffers as it runs?
>
To some extent. Most pg_dump activity involves sequential scans that
are reading an entire table. Those are no different from any other
process that will put disk blocks into shared_buffers. However, that
usage pattern makes pg_dump particularly likely to run into an
optimization in 8.3 and later that limits how much of shared_buffers is
used when sequentially scanning a large table. See P10 of
http://www.westnet.com/~gsmith/content/postgresql/InsideBufferCache.pdf
for the exact implementation. Basically, anything bigger than
shared_buffers / 4 uses a 256K ring to limit its cache use, but it's a
little more complicated than that.
--
Greg Smith 2ndQuadrant US Baltimore, MD
PostgreSQL Training, Services and Support
greg@2ndQuadrant.com www.2ndQuadrant.us
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 using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: greg@2ndquadrant.com, lance@illinois.edu
Subject: Re: How much memory is PostgreSQL using
In-Reply-To: <4BB0DB0D.80208@2ndquadrant.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