Re: postgresql 9.1 out of memory

From: Kevin Grittner <kgrittn(at)ymail(dot)com>
To: Евгений Селявка <evg(dot)selyavka(at)gmail(dot)com>, "pgsql-admin(at)postgresql(dot)org" <pgsql-admin(at)postgresql(dot)org>
Subject: Re: postgresql 9.1 out of memory
Date: 2013-10-30 15:14:09
Message-ID: 1383146049.700.YahooMailNeo@web162906.mail.bf1.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Евгений Селявка <evg(dot)selyavka(at)gmail(dot)com> wrote:

> Server HW:

> 32GB RAM

> Before server crash i have this parameters in config:
>
> max_connections = 350

> work_mem = 2GB

> After crash  i change this parameters:

> work_mem = 1GB

A good "rule of thumb" is to allow for one work_mem allocation per
connection for a reasonable estimation of peak memory usage for
this purpose.  (This may need to be adjusted based on workload, but
it's a reasonable place to start.)  So you have adjusted likely
peaks down from 700GB to 350GB.

I usually start with work_mem set to RAM * 25% / max_connections.
In your case that works out to 23MB.  If you are able to use a
connection pooler to reducee max_connections, that will allow you
to boost work_mem.

--
Kevin Grittner
EDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Drazen Kacar 2013-10-30 16:35:23 Zeroed out pages at the end of the database files
Previous Message JotaComm 2013-10-30 12:31:22 Re: pg_dump being killed by oom killer