Обсуждение: Postgres shutting down by itself...why?

Поиск
Список
Период
Сортировка

Postgres shutting down by itself...why?

От
"Dave Horn"
Дата:
I've recently installed Postgres 8.2.x on a RedHat Linux system.  Everything
seems fine and normal.  I can start and stop the server without errors.
When the server is running, everything appears normal.  The problem is that
about every 2 to 3 hours I find the server is just not running anymore.
I've turned on logging at the info level and up and am not getting any
messages that is giving me any clue why the server is shutting down.

I get the following when I restart after I've discovered its down

LOG:  database system was interrupted at 2007-11-29 14:25:48 CST
LOG:  checkpoint record is at 0/43FBE0
LOG:  redo record is at 0/43FBE0; undo record is at 0/0; shutdown TRUE
LOG:  next transaction ID: 0/837; next OID: 32773
LOG:  next MultiXactId: 1; next MultiXactOffset: 0
LOG:  database system was not properly shut down; automatic recovery in
progress
LOG:  record with zero length at 0/43FC28
LOG:  redo is not required
LOG:  database system is ready

The server is not even being used at this point.  I can literally start the
server come back a few hours later and find its not running.

Any assistance, ideas, suggestions would be greatly appreciated.  Thanks
all.


Re: Postgres shutting down by itself...why?

От
Tom Lane
Дата:
"Dave Horn" <dave@hitforthecycle.com> writes:
> I've recently installed Postgres 8.2.x on a RedHat Linux system.  Everything
> seems fine and normal.  I can start and stop the server without errors.
> When the server is running, everything appears normal.  The problem is that
> about every 2 to 3 hours I find the server is just not running anymore.
> I've turned on logging at the info level and up and am not getting any
> messages that is giving me any clue why the server is shutting down.

I've never seen or heard of a case of PG shutting down "by itself".
You should be looking for outside causes.  What else is running
on that system?

If there is absolutely nothing in the server log file mentioning
a shutdown, I would tend to think that something has kill -9'd
the postmaster process.  This has been known to happen on
short-of-memory Linux systems, if you don't disable memory overcommit
(google "OOM kill" for details).

Whether that's it or not, the kernel syslog file would be a good
first stop to check for clues.

Oh, another line of thought: maybe you are launching the postmaster
under restrictive ulimit settings that kill it after not very much
runtime?

            regards, tom lane

Re: Postgres shutting down by itself...why?

От
"Dave Horn"
Дата:
Thanks Tom.  I don't know what change I've made that the server seems to
like, but it ran all weekend with no problems.  But I've definitely got some
new things to consider if/when it starts having this problem again.  Thanks.

-----Original Message-----
From: Tom Lane [mailto:tgl@sss.pgh.pa.us]
Sent: Friday, November 30, 2007 8:22 PM
To: Dave Horn
Cc: pgsql-general@postgresql.org
Subject: Re: [GENERAL] Postgres shutting down by itself...why?


"Dave Horn" <dave@hitforthecycle.com> writes:
> I've recently installed Postgres 8.2.x on a RedHat Linux system.
Everything
> seems fine and normal.  I can start and stop the server without errors.
> When the server is running, everything appears normal.  The problem is
that
> about every 2 to 3 hours I find the server is just not running anymore.
> I've turned on logging at the info level and up and am not getting any
> messages that is giving me any clue why the server is shutting down.

I've never seen or heard of a case of PG shutting down "by itself".
You should be looking for outside causes.  What else is running
on that system?

If there is absolutely nothing in the server log file mentioning
a shutdown, I would tend to think that something has kill -9'd
the postmaster process.  This has been known to happen on
short-of-memory Linux systems, if you don't disable memory overcommit
(google "OOM kill" for details).

Whether that's it or not, the kernel syslog file would be a good
first stop to check for clues.

Oh, another line of thought: maybe you are launching the postmaster
under restrictive ulimit settings that kill it after not very much
runtime?

            regards, tom lane