Re: Postgres kills machine

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bradley Kieser <brad(at)kieser(dot)net>
Cc: PgSQL ADMIN <pgsql-admin(at)postgresql(dot)org>
Subject: Re: Postgres kills machine
Date: 2005-01-09 17:15:48
Message-ID: 27868.1105290948@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Bradley Kieser <brad(at)kieser(dot)net> writes:
> Periodically we have queries (can't log in to see which ones) that kill
> our machine by consuming huge amounts of resource.

The first thing you need to do is find out what they are so you can fix
them. Turning on logging of all statements would be a worthwhile
investment.

> The errors in the syslog are all to do with VM, so I assume that we are
> running out of RAM. There is 1.5GB of RAM in the box which should be
> more than enough for the databases that we run.

What have you got sort_mem and max_connections set to?

> I know that I can set process limits in the limits.conf file, but can
> anyone suggest sensible values to put in there to limit the max memory
> to 200MB per pg process?

Personally I'd put "ulimit -d 200000000" into the postmaster startup script.

> I have read that limits.conf only works if PG is linked using PAM and
> someone in a thread said that PG doesn't use PAM. Can someone please
> advise me on this?

PAM has nothing to do with per-process limits.

regards, tom lane

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Mitchell Laks 2005-01-09 19:08:55 input in flex scanner failed
Previous Message Bradley Kieser 2005-01-09 14:31:54 Postgres kills machine