pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
how to estimate shared_buffers...
3+ messages / 3 participants
[nested] [flat]

* how to estimate shared_buffers...
@ 2008-07-12 11:30  Jessica Richard <rjessil@yahoo.com>
  0 siblings, 2 replies; 3+ messages in thread

From: Jessica Richard @ 2008-07-12 11:30 UTC (permalink / raw)
  To: pgsql-performance

On a running production machine, we have 900M configured on a 16G-memory Linux host. The db size for all dbs combined is about 50G.  There are many transactions going on all the times (deletes, inserts, updates). We do not have a testing environment that has the same setup and the same amount of workload. I want to evaluate on the production host if this 900M is enough. If not, we still have room to go up a little bit to speed up all Postgres activities. I don't know enough about the SA side. I just would imagine, if something like "top" command or other tools can measure how much total memory Postgres is actually using (against the configured 900M shared buffers), and if Postgres is using almost 900M all the time, I would take this as an indication that the shared_buffers can go up for another 100M...

What is the best way to tell how much memory Postgres (all Postgres related things) is actually using?

Thanks
Jessica



      

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

* Re: how to estimate shared_buffers...
@ 2008-07-12 13:05  Scott Marlowe <scott.marlowe@gmail.com>
  parent: Jessica Richard <rjessil@yahoo.com>
  1 sibling, 0 replies; 3+ messages in thread

From: Scott Marlowe @ 2008-07-12 13:05 UTC (permalink / raw)
  To: Jessica Richard <rjessil@yahoo.com>; +Cc: pgsql-performance

On Sat, Jul 12, 2008 at 5:30 AM, Jessica Richard <rjessil@yahoo.com> wrote:
> On a running production machine, we have 900M configured on a 16G-memory
> Linux host. The db size for all dbs combined is about 50G.  There are many
> transactions going on all the times (deletes, inserts, updates). We do not
> have a testing environment that has the same setup and the same amount of
> workload. I want to evaluate on the production host if this 900M is enough.
> If not, we still have room to go up a little bit to speed up all Postgres
> activities. I don't know enough about the SA side. I just would imagine, if
> something like "top" command or other tools can measure how much total
> memory Postgres is actually using (against the configured 900M shared
> buffers), and if Postgres is using almost 900M all the time, I would take
> this as an indication that the shared_buffers can go up for another 100M...
>
> What is the best way to tell how much memory Postgres (all Postgres related
> things) is actually using?

If you've got a 50G data set, then postgresql is most likely using
whatever memory you give it for shared buffers.  top should show that
easily.

I'd say start at 25% ~ 4G (this is a 64 bit machine, right?).  That
leaves plenty of memory for the OS to cache data, and for postgresql
to allocate work_mem type stuff from.



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

* Re: how to estimate shared_buffers...
@ 2008-07-12 14:30  Oleg Bartunov <oleg@sai.msu.su>
  parent: Jessica Richard <rjessil@yahoo.com>
  1 sibling, 0 replies; 3+ messages in thread

From: Oleg Bartunov @ 2008-07-12 14:30 UTC (permalink / raw)
  To: Jessica Richard <rjessil@yahoo.com>; +Cc: pgsql-performance

On Sat, 12 Jul 2008, Jessica Richard wrote:

> On a running production machine, we have 900M configured on a 16G-memory Linux host. The db size for all dbs combined is about 50G.  There are many transactions going on all the times (deletes, inserts, updates). We do not have a testing environment that has the same setup and the same amount of workload. I want to evaluate on the production host if this 900M is enough. If not, we still have room to go up a little bit to speed up all Postgres activities. I don't know enough about the SA side. I just would imagine, if something like "top" command or other tools can measure how much total memory Postgres is actually using (against the configured 900M shared buffers), and if Postgres is using almost 900M all the time, I would take this as an indication that the shared_buffers can go up for another 100M...
>
> What is the best way to tell how much memory Postgres (all Postgres related things) is actually using?

there is a contrib/pg_buffers which can tell you about usage of shared 
memory. Also, you can estimate how much memory of OS cache occupied by
postgres files (tables, indexes). Looks on 
http://www.kennygorman.com/wordpress/?p=246 for some details.
I wrote a perl script, which simplifies estimation of OS buffers, but
it's not yet ready for public.


 	Regards,
 		Oleg
_____________________________________________________________
Oleg Bartunov, Research Scientist, Head of AstroNet (www.astronet.ru),
Sternberg Astronomical Institute, Moscow University, Russia
Internet: oleg@sai.msu.su, http://www.sai.msu.su/~megera/
phone: +007(495)939-16-83, +007(495)939-23-83



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


end of thread, other threads:[~2008-07-12 14:30 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2008-07-12 11:30 how to estimate shared_buffers... Jessica Richard <rjessil@yahoo.com>
2008-07-12 13:05 ` Scott Marlowe <scott.marlowe@gmail.com>
2008-07-12 14:30 ` Oleg Bartunov <oleg@sai.msu.su>

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