Re: DB Restart

From: Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com>
To: Sam Jas <samjas33(at)yahoo(dot)com>
Cc: general <pgsql-general(at)postgresql(dot)org>
Subject: Re: DB Restart
Date: 2009-11-12 13:51:27
Message-ID: dcc563d10911120551j11ebec07rfaf7598d14ca2133@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

(Please refrain from html email on the list)

On Thu, Nov 12, 2009 at 12:10 AM, Sam Jas <samjas33(at)yahoo(dot)com> wrote:
>
> Hi,
>
> We are facing issue with the RES memory. Below is the o/p of top command. It shows that writer process reserved 3.8g. We have observed that if it increased to 3.9g we need to restart the db. Otherwise it hangs.  Kindly suggest us the good way to figure it out this issue.   shared_buffer is 3 GB.

Are you sure this is what your problem really is? It's quite normal
for the bgwriter to show a high res / shr number because it touches
all the shared_buffers eventually. On my main db at work, where we
have 8G shared_buffers, it looks like this:

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
32284 postgres 15 0 8446m 7.5g 7.5g S 0.0 23.8 2:35.10 postgres:
writer process
337 postgres 15 0 8475m 7.0g 7.0g S 0.0 22.2 116:15.04 postgres:
slony www 10.0.0.104(56186) idle
336 postgres 16 0 8455m 4.7g 4.7g S 4.1 14.8 148:57.29 postgres:
slony www 10.0.0.104(56184) COMMIT
335 postgres 18 0 8457m 3.9g 3.9g S 0.0 12.5 598:04.23 postgres:
slony www 10.0.0.104(56183) idle

Note that the amount of memory used by a process on its own is
RES-SHR, so that none of these processes are actually using 7.5, 7.0,
4.7 or 3.9 Gigs by themselves.

> PID       USER      PR  NI  VIRT   RES  SHR S %CPU %MEM    TIME+  COMMAND
>
>  4822 postgres  15   0 4045m 3.8g 3.8g S  0.7 12.1   2:09.63 postgres: writer process

Generally this isn't a problem. Is this 100% reproduce-able? Are you
sure there's no other problem, or that maybe a checkpoint kicks in at
the same time and your "hung" database isn't just unresponsive for a
minute or so?

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Scott Marlowe 2009-11-12 13:52:18 Re: DB Restart
Previous Message Grzegorz Jaśkiewicz 2009-11-12 13:49:57 Re: re-using RETURNING