[ADMIN] Postgres kills machine

2005-01-09 Thread Bradley Kieser
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 [EMAIL PROTECTED])


Re: [ADMIN] Postgres kills machine

2005-01-09 Thread Tom Lane
Bradley Kieser <[EMAIL PROTECTED]> 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 2" 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


[ADMIN] input in flex scanner failed

2005-01-09 Thread Mitchell Laks
Hi,
I have about 35 servers running Postgresql. On one of my older ones, which just 
serves up old data with no new data being added, 
and running on redhat 7.3 with postgresql 7.2.4, I am getting repeated episodes 
of the database shutdown while the system is still up. I find this very 
unusual. 

When I log in to the machine and I run pg_ctl start I get the message
input in flex scanner failed
and the Postgresql database system does not start up. :(.

I suppose, I should just do my work and reinstall linux - debian and the latest 
postgresql - but does anyone know what this error means before I blow the 
machine away?

Thanks for all your help,
Mitchell Laks


---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?

   http://www.postgresql.org/docs/faqs/FAQ.html


Re: [ADMIN] input in flex scanner failed

2005-01-09 Thread Tom Lane
Mitchell Laks <[EMAIL PROTECTED]> writes:
> When I log in to the machine and I run pg_ctl start I get the message
> input in flex scanner failed
> and the Postgresql database system does not start up. :(.

That seems a tad impossible :-(.

Where did you come by this Postgres build exactly --- is it from an RPM,
or home built?  The only theories that come to mind have to do with an
incompatibility between the flex version that PG 7.2.4 expected (namely
2.5.4) and the one it was actually built with.

If the installation used to work and is now failing like this then I
think you are looking at plain old corrupted executables; a reinstall
should fix it.

regards, tom lane

---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster