Re: "out of memory" error

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Christian Schröder <cs(at)deriva(dot)de>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-general(at)postgresql(dot)org
Subject: Re: "out of memory" error
Date: 2007-08-23 18:46:06
Message-ID: 20070823184606.GC27764@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, Aug 23, 2007 at 08:30:46PM +0200, Christian Schröder wrote:
> Thanks for your tips! I have changed the "shared_buffers" setting back
> to 2 GB. It was set to 2 GB before, but we also had "out of memory"
> errors with this setting, so I raised it to 3 GB.

You've got it completely wrong. By setting shared_buffers to 2GB it
means no-one can use it. It's not postgres that's running out of
memory, it's the rest of your system. Set it to something sane like
128MB or maybe smaller.

It's a cache, nothing more, small values does not mean you can't run big
queries.

The rest of Tom's comment was about how large shared_buffer is worse
because it eats away at your real disk cache and your performance will
completely tank.

Have a nice day,

> Doesn't that mean that plenty of memory is unused? I always thought
> that the memory used for buffers and caches can be thought of as free
> memory. Isn't this correct?

Postgresql shared_buffers is not "free". It should be around your
actually working set size, much bigger is counter productive.

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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Bill Moran 2007-08-23 18:55:47 Re: Apache + PHP + Postgres Interaction
Previous Message Joshua D. Drake 2007-08-23 18:35:20 Re: PostgreSQL vs Firebird feature comparison finished