pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
How to determine if my setting for shared_buffers is too high?
3+ messages / 3 participants
[nested] [flat]

* How to determine if my setting for shared_buffers is too high?
@ 2006-12-07 16:42  Bill Moran <wmoran@collaborativefusion.com>
  0 siblings, 2 replies; 3+ messages in thread

From: Bill Moran @ 2006-12-07 16:42 UTC (permalink / raw)
  To: pgsql-performance


I'm gearing up to do some serious investigation into performance for
PostgreSQL with regard to our application.  I have two issues that I've
questions about, and I'll address them in two seperate emails.

This one regards tuning shared_buffers.

I believe I have a good way to monitor database activity and tell when
a database grows large enough that it would benefit from more
shared_buffers: if I monitor the blks_read column of pg_stat_database,
it should increase very slowly if there is enough shared_buffer
space.  When shared buffer space runs out, more disk read requests
will be required and this number will begin to climb.

If anyone sees a flaw in this approach, I'd be interested to hear it.

The other tuning issue with shared_buffers is how to tell if I'm
allocating too much.  For example, if I allocate 1G of RAM to
shared buffers, and the entire database can fit in 100M, that 900M
might be better used as work_mem, or something else.

I haven't been able to find anything regarding how much of the
shared buffer space PostgreSQL is actually using, as opposed to
simply allocating.

-- 
Bill Moran
Collaborative Fusion Inc.

wmoran@collaborativefusion.com
Phone: 412-422-3463x4023



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

* Re: How to determine if my setting for shared_buffers is too high?
@ 2006-12-07 17:04  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Bill Moran <wmoran@collaborativefusion.com>
  1 sibling, 0 replies; 3+ messages in thread

From: Tom Lane @ 2006-12-07 17:04 UTC (permalink / raw)
  To: Bill Moran <wmoran@collaborativefusion.com>; +Cc: pgsql-performance

Bill Moran <wmoran@collaborativefusion.com> writes:
> I haven't been able to find anything regarding how much of the
> shared buffer space PostgreSQL is actually using, as opposed to
> simply allocating.

In 8.1 and up, contrib/pg_buffercache/ would give you some visibility
of this.

			regards, tom lane



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

* Re: How to determine if my setting for shared_buffers is too high?
@ 2006-12-08 19:19  Jim C. Nasby <jim@nasby.net>
  parent: Bill Moran <wmoran@collaborativefusion.com>
  1 sibling, 0 replies; 3+ messages in thread

From: Jim C. Nasby @ 2006-12-08 19:19 UTC (permalink / raw)
  To: Bill Moran <wmoran@collaborativefusion.com>; +Cc: pgsql-performance

Remember that as you increase shared_buffers you might need to make the
bgwriter more aggressive too.

On Thu, Dec 07, 2006 at 11:42:39AM -0500, Bill Moran wrote:
> 
> I'm gearing up to do some serious investigation into performance for
> PostgreSQL with regard to our application.  I have two issues that I've
> questions about, and I'll address them in two seperate emails.
> 
> This one regards tuning shared_buffers.
> 
> I believe I have a good way to monitor database activity and tell when
> a database grows large enough that it would benefit from more
> shared_buffers: if I monitor the blks_read column of pg_stat_database,
> it should increase very slowly if there is enough shared_buffer
> space.  When shared buffer space runs out, more disk read requests
> will be required and this number will begin to climb.
> 
> If anyone sees a flaw in this approach, I'd be interested to hear it.
> 
> The other tuning issue with shared_buffers is how to tell if I'm
> allocating too much.  For example, if I allocate 1G of RAM to
> shared buffers, and the entire database can fit in 100M, that 900M
> might be better used as work_mem, or something else.
> 
> I haven't been able to find anything regarding how much of the
> shared buffer space PostgreSQL is actually using, as opposed to
> simply allocating.
> 
> -- 
> Bill Moran
> Collaborative Fusion Inc.
> 
> wmoran@collaborativefusion.com
> Phone: 412-422-3463x4023
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 5: don't forget to increase your free space map settings
> 

-- 
Jim Nasby                                            jim@nasby.net
EnterpriseDB      http://enterprisedb.com      512.569.9461 (cell)



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


end of thread, other threads:[~2006-12-08 19:19 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2006-12-07 16:42 How to determine if my setting for shared_buffers is too high? Bill Moran <wmoran@collaborativefusion.com>
2006-12-07 17:04 ` Tom Lane <tgl@sss.pgh.pa.us>
2006-12-08 19:19 ` Jim C. Nasby <jim@nasby.net>

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