Re: Database server restarting

From: "scott(dot)marlowe" <scott(dot)marlowe(at)ihs(dot)com>
To: shoaib <shoaibm(at)vmoksha(dot)com>
Cc: "'Martijn van Oosterhout'" <kleptog(at)svana(dot)org>, <gearond(at)cvc(dot)net>, "'Nigel J(dot) Andrews'" <nandrews(at)investsystems(dot)co(dot)uk>, <pgsql-general(at)postgresql(dot)org>
Subject: Re: Database server restarting
Date: 2003-05-06 16:38:06
Message-ID: Pine.LNX.4.33.0305061034520.5947-100000@css120.ihs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Here's a little script that will run top every so often and log the output
to a file you can read later when the machine's recovered.

#!/bin/bash
for ((a=0;a=1;a=0)) do {
top -bn 1 >>log.txt
sleep 60
}

Just run it in your home directory. Make sure your /home partition has
enough space. Under heavy load each 60 seconds you'll be adding about 2k
to 5k to that file. Change the sleep 60 to something smaller if you want
it to run more often. No warranties implied, use at your own risk. :-)

On Tue, 6 May 2003, shoaib wrote:

> There are some cron jobs running at the same time...
> One server does SSH into our application server and on cron job is
> reading the DB and writing some data into flat files. But by the time
> this problem is happening these jobs are not writing any data. Last
> night when the server went down the other server wa trying to do SsH and
> probably it was running some cron job and a heavy DB process was
> running.I can not do a top bcoz I can not login into server even from
> console.
>
> Regards
> shaoib
>
>
> -----Original Message-----
> From: Martijn van Oosterhout [mailto:kleptog(at)svana(dot)org]
> Sent: Tuesday, May 06, 2003 2:40 PM
> To: shoaib
> Cc: gearond(at)cvc(dot)net; 'Nigel J. Andrews'; pgsql-general(at)postgresql(dot)org
> Subject: Re: [GENERAL] Database server restarting
>
> On Tue, May 06, 2003 at 02:28:57PM +0800, shoaib wrote:
> > When I say hangs it means ..I am not even able to login at the server
> > console also.
> > No ssh, no login form remote machines.
>
> Well, that's not postgresql's fault. It can't hang a machine like that.
> You
> should look elsewhere for the exact cause. I'm assuming here that
> consoles
> that are still logged in don't respond either? Maybe leave a top running
> to
> capture the list of processes just before it dies? Any cronjobs about
> the
> time it dies?
>
> What other processes run at about that time?
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Bruno Wolff III 2003-05-06 17:27:36 Re: advancing sequences
Previous Message Dmitri Bichko 2003-05-06 16:13:44 advancing sequences