Re: "out of memory" error - Mailing list pgsql-general

From Martijn van Oosterhout
Subject Re: "out of memory" error
Date
Msg-id 20070823184606.GC27764@svana.org
Whole thread Raw
In response to Re: "out of memory" error  (Christian Schröder <cs@deriva.de>)
Responses Re: "out of memory" error
Re: "out of memory" error
List 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@svana.org>   http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

Attachment

pgsql-general by date:

Previous
From: "Joshua D. Drake"
Date:
Subject: Re: PostgreSQL vs Firebird feature comparison finished
Next
From: Bill Moran
Date:
Subject: Re: Apache + PHP + Postgres Interaction