Re: out of memory woes

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Angva <angvaw(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: out of memory woes
Date: 2006-12-20 14:33:29
Message-ID: 20061220143329.GF30769@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Angva wrote:
> We found that the kernel setting SHMALL was set ridiculously high -
> 1024g!. Someone noticed this when running "ipcs -lm" - seemed just a
> tad off. :)

That's not a problem because it's just a limit. It won't cause out of
memory or anything.

The problem with work_mem is that the system may request that much
memory for every Sort step. Each query may have more than one of those,
and each backend can be serving more than one query at a time. So those
200000 you have quickly turn into the gigabytes and consume the whole of
your RAM.

If a Sort step requires more than work_mem for its work, it will go to
disk -- but in a much faster way than what the kernel is able to do with
swap. So whenever you are trading work_mem for swap, you are losing big
time. You should decrease that figure.

--
Alvaro Herrera http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2006-12-20 14:44:02 Re: plperl trigger problem
Previous Message Derrick Stensrud 2006-12-20 13:07:18 Re: postgres kerberos how to