pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: tv@fuzzy.cz
To: Matthew Wakeling <matthew@flymine.org>
Cc: pgsql-performance@postgresql.org
Subject: Re: Postgres using more memory than it should
Date: Wed, 3 Dec 2008 17:25:12 +0100 (CET)
Message-ID: <61517.89.102.139.23.1228321512.squirrel@sq.gransy.com> (raw)
In-Reply-To: <alpine.DEB.1.10.0812031554330.4666@aragorn.flymine.org>
References: <alpine.DEB.1.10.0812031554330.4666@aragorn.flymine.org>

>
> Hi. I have a problem on one of our production servers. A fairly
> complicated query is running, and the backend process is using 30 GB of
> RAM. The machine only has 32GB, and is understandably swapping like crazy.
> My colleague is creating swap files as quickly as it can use them up.
>
> The work_mem setting on this machine is 1000MB, running Postgres 8.3.0.

Are you aware that this is a per-session / per-sort settings? That means,
if you have 10 sessions, each of them running query with 2 sort steps in
the plan, it may occupy up to 20 GB of RAM (if both sorts use the whole
1GB of RAM).

regards
Tomas




view thread (10+ messages)  latest in thread

Message-ID: <61517.89.102.139.23.1228321512.squirrel@sq.gransy.com>
Permalink:  ../61517.89.102.139.23.1228321512.squirrel@sq.gransy.com/
Also on:    postgresql.org/message-id/61517.89.102.139.23.1228321512.squirrel@sq.gransy.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-performance@postgresql.org
  Cc: tv@fuzzy.cz, matthew@flymine.org
  Subject: Re: Postgres using more memory than it should
  In-Reply-To: <61517.89.102.139.23.1228321512.squirrel@sq.gransy.com>
  References: <alpine.DEB.1.10.0812031554330.4666@aragorn.flymine.org> <61517.89.102.139.23.1228321512.squirrel@sq.gransy.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox