Thread: postmaster crash - another server process exited abnormally

postmaster crash - another server process exited abnormally

From
"Michael Korotun"
Date:

Hi Guys,

 

I am writing here again. Here is the scenario of my problem:

 

I have Postgres 8.0.1 on Linux FC3 and everything goes fine, except that a one time per week approximately I am getting server crash with a message in log:

 

==========================

LOG:  server process (PID 5252) was terminated by signal 9

LOG:  terminating any other active server processes

WARNING:  terminating connection because of crash of another server process

DETAIL:  The postmaster has commanded this server process to roll back the current transaction and exit, because another server process exited abnormally and possibly corrupted shared memory.

HINT:  In a moment you should be able to reconnect to the database and repeat your command.

 

This message is appearing perhaps 40x times and server stopped. I am wondering how can I get details of where it comes from? What is the process is crashing and what causes it. Please, any help is greatly appreciated as always.

 

 

 

 

Best Regards,

Michael Korotun

 

Re: postmaster crash - another server process exited abnormally

From
Richard Huxton
Date:
Michael Korotun wrote:
>
> I have Postgres 8.0.1 on Linux FC3 and everything goes fine, except that a
> one time per week approximately I am getting server crash with a message in
> log:

> LOG:  server process (PID 5252) was terminated by signal 9

Sounds like something is sending SIGKILL (kill -9) to your backend
processes. If you're not doing it, I don't suppose you could be running
out of RAM could you? The Linux out-of-memory (oom) process killer has
traditionally been fairly useless at choosing "safe" processes to kill.

--
   Richard Huxton
   Archonet Ltd

Re: postmaster crash - another server process exited

From
Scott Marlowe
Date:
On Fri, 2005-05-06 at 07:54, Michael Korotun wrote:
> Hi Guys,
>
>
>
> I am writing here again. Here is the scenario of my problem:
>
>
>
> I have Postgres 8.0.1 on Linux FC3 and everything goes fine, except
> that a one time per week approximately I am getting server crash with
> a message in log:
>
>
>
> ==========================
>
> LOG:  server process (PID 5252) was terminated by signal 9
>
> LOG:  terminating any other active server processes
>
> WARNING:  terminating connection because of crash of another server
> process
>
> DETAIL:  The postmaster has commanded this server process to roll back
> the current transaction and exit, because another server process
> exited abnormally and possibly corrupted shared memory.
>
> HINT:  In a moment you should be able to reconnect to the database and
> repeat your command.

Some process other than postgres itself is likely sending this, and it
could well be the kernel OOM killer at work, depending on your memory
usage and pg configuration.

What does dmesg say, if anything?

Re: postmaster crash - another server process exited abnormally

From
Richard Huxton
Date:
Michael Korotun wrote:
> Yes, this is oom
> Firstly it killed httpd and then postmaster. But who took all the memory? I
> see there Free swap: 0Kb in the messages log - was it a reason?

Sounds likely.

> I have 1GB of RAM. For shared memory I took about 262MB.
>
> /etc/sysctl.conf
> ===================
> #shared memory increase to 262 MB
> kernel.shmmax=268435456
> kernel.shmall=268435456
> ====================
>
> Postgresql.conf
> =======================
> Max_connections = 100
> shared_buffers = 20000          # min 16, at least max_connections*2, 8KB

What's your sort-mem? That is the memory per-sort, and you can have
several sorts in one query.

Also - might be worth checking if you have reasonable memory constraints
for Apache / PHP (if you are running it).

--
   Richard Huxton
   Archonet Ltd