Re: How to find how much postgresql use the memory?

From: Luki Rustianto <lukirus(at)gmail(dot)com>
To: Albe Laurenz <laurenz(dot)albe(at)wien(dot)gv(dot)at>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: How to find how much postgresql use the memory?
Date: 2009-01-21 01:30:35
Message-ID: a87d9f3a0901201730g1e4a98a5md27f8d3e1cc2ce5d@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Ok I see. So what's the best way to find optimum value for various
memory-related setting of postgresql ?

On Tue, Jan 20, 2009 at 3:27 PM, Albe Laurenz <laurenz(dot)albe(at)wien(dot)gv(dot)at>wrote:

> > I wonder how to find how much postgresql memory consumption
> > is (real, not allocated) ?
>
> You could install the pg_buffercache contrib and
>
> SELECT pg_size_pretty(
> CAST(current_setting('block_size') AS integer) * max(bufferid)
> )
> FROM pg_buffercache WHERE relfilenode IS NOT NULL;
>
> to find out how much of the shared memory in the buffer pool is
> actually in use.
>
> There is some extra shared memory that is used for other purposes,
> and there is private memory of the backends (the latter could be
> a significant number).
>
> Why do you want that number?
> If it is for tuning of shared_buffers, that is probably a bad way.
> Even if shared_buffers is set much higher than you'd actually need
> it, sooner or later all of your shared_buffers will be used, unless
> your database is tiny.
>
> Yours,
> Laurenz Albe
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Robert Treat 2009-01-21 02:51:25 Re: Database schema & data synchronizer software for PostgreSQL?
Previous Message Roger Leigh 2009-01-21 00:05:59 Custom type, operators and operator class not sorting/indexing correctly