Unix Technical Forum

Postgres kills machine

This is a discussion on Postgres kills machine within the pgsql Admins forums, part of the PostgreSQL category; --> Periodically we have queries (can't log in to see which ones) that kill our machine by consuming huge amounts ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Admins

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-10-2008, 01:15 AM
Bradley Kieser
 
Posts: n/a
Default Postgres kills machine

Periodically we have queries (can't log in to see which ones) that kill
our machine by consuming huge amounts of resource. I thought that I had
fixed this by writing a cron job that vacuums all the databases every
night, but today our machine froze again.

We run PG on Linux, for the machine in question is it Mandrake 10.0.

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.

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?

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?

Thanks,

Brad


---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to majordomo@postgresql.org)

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-10-2008, 01:15 AM
Tom Lane
 
Posts: n/a
Default Re: Postgres kills machine

Bradley Kieser <brad@kieser.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

---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 09:22 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
www.UnixAdminTalk.com