Re: Controlling memory of session

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Magnus Hagander <magnus(at)hagander(dot)net>
Cc: James Im <im-james(at)hotmail(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Controlling memory of session
Date: 2007-01-18 12:37:34
Message-ID: 20070118123734.GC29963@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, Jan 18, 2007 at 11:52:12AM +0100, Magnus Hagander wrote:
> > Not knowing how much RAM can take the server is annoying. You have to be
> > extra careful and scale the server down as you don't know what will happen.
>
> The fact that work_mem is "per sort" and not "per backend" is going to
> cause you more problems than the overhead in trying to figure out how
> far you can do. The fact that there is no "work_mem per backend" is
> certainly very annoying, but it's obviously hard to fix or it would've
> been fixed already :-)

If you knew beforehand how much memory you were going to need, you
wouldn't need to run any queries because you'd know the answers already
:)

What exactly would you expect to happen? At some point you run a query
and it says "out of memory", even though your machine has masses of
memory left over? A bit like VM overcommit?

If you know your queries don't generally use more than one sort, it's
fairly easy to estimate memory usage. The best way to find out how many
backends you can handle is: simulation. Anything else is guesswork.

Have a nice day,
--
Martijn van Oosterhout <kleptog(at)svana(dot)org> http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Bill Moran 2007-01-18 13:07:15 Re: Index bloat of 4x
Previous Message Frank Wittig 2007-01-18 11:47:18 Re: Get SQL dump from readonly FS