Re: optimal memory

From: Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com>
To: Sim Zacks <sim(at)compulab(dot)co(dot)il>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: optimal memory
Date: 2010-08-03 09:35:42
Message-ID: AANLkTikDp2SVyJ4w_8=4WVKaLqYC0tNov0ToN6Wwt+N6@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

2010/8/3 Sim Zacks <sim(at)compulab(dot)co(dot)il>:
> Is there a way to tell what the optimal memory is for a specific
> postgresql instance?
>
> I am configuring Xen virtual machines and I don't want to give it more
> then it needs.
>
> Would looking at the swap be an indication? As soon as it starts to use
> swap, that means I need more, but until that point, I have enough?

Once you start using swap space it's WAY too small. If your db is say
1GB, and you have 10 or so connections running at once, and each might
need 20MB of work_mem, then it would be good to at least 2Gig or so so
that the db can be cached by the cache and you've got enough memory
left over for the db to allocate enough shared_buffers to hold a
decent chunk of it (say 256 to 512Meg).

OTOH, if your database is 1TB in size, then you can't really have too
much memory, as every bit you throw at the machine will help.

So, about how big is your db? How many users are likely to be running
queries at once? How big of a chunk of data are those users likely to
each need for sorts etc?

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jason Schauberger 2010-08-03 12:01:58 Nodes and trees...
Previous Message A. Kretschmer 2010-08-03 09:00:04 Re: optimal memory