Re: How much memory is PostgreSQL using

От: Campbell, Lance
Тема: Re: How much memory is PostgreSQL using
Дата: ,
Msg-id: B10E6810AC2A2F4EA7550D072CDE876004B2E249@SAB-FENWICK.sab.uiuc.edu
(см: обсуждение, исходный текст)
Ответ на: Re: How much memory is PostgreSQL using  (Greg Smith)
Ответы: Re: How much memory is PostgreSQL using  (Guillaume Lelarge)
Список: pgsql-performance

Скрыть дерево обсуждения

How much memory is PostgreSQL using  ("Campbell, Lance", )
 Re: How much memory is PostgreSQL using  (Greg Smith, )
  Re: How much memory is PostgreSQL using  ("Campbell, Lance", )
   Re: How much memory is PostgreSQL using  (Guillaume Lelarge, )

Greg,
Thanks for your help.

1) How does the number of buffers provided by pg_buffercache compare to
memory (buffers * X = Y meg)?
2) Is there a way to tell how many total buffers I have available/max?

Thanks,

Lance Campbell
Software Architect/DBA/Project Manager
Web Services at Public Affairs
217-333-0382


-----Original Message-----
From: Greg Smith [mailto:]
Sent: Monday, March 29, 2010 11:54 AM
To: Campbell, Lance
Cc: 
Subject: Re: [PERFORM] How much memory is PostgreSQL using

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
   www.2ndQuadrant.us



В списке pgsql-performance по дате сообщения:

От: John Beaver
Дата:
Сообщение: Re: *** PROBABLY SPAM *** Does the psql executable support a "fetch many" approach when dumping large queries to stdout?
От: David Crooke
Дата:
Сообщение: David Crooke wants to stay in touch on LinkedIn