Re: When is postmaster ready?

From: Robert Treat <xzilla(at)users(dot)sourceforge(dot)net>
To: Michiel Lange <michiel(at)minas(dot)demon(dot)nl>
Cc: alien(at)spaceship(dot)com, pgsql-admin(at)postgresql(dot)org
Subject: Re: When is postmaster ready?
Date: 2003-04-14 14:14:39
Message-ID: 1050329679.9816.23.camel@camel
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

There is actually a delay between when postmaster starts and it is ready
to accept connections. If you try to connect too soon you'll get the
"database system is starting up" message. IIRC in one particular script
we settled on waiting 5 seconds before trying to connect, which seemed
to be enough time elapsing for us (1 second wasn't in some stress
testing type cases). If you want to do it the way its done in some of
the postgresql scripts, you need to grep the output of a psql connection
for success; check out pg_ctl for a good example of this.

Robert Treat

On Sat, 2003-04-12 at 21:15, Michiel Lange wrote:
> From my experience, the time that it takes before it is ready is less than
> a second, so I think you can safely assume the system is ready directly
> after the script tells the postmaster is ready... (otherwise the script
> would be lying to you...)
>
> At 16:57 12-4-2003 -0500, Matt Mello wrote:
> >I have a startup script that first starts up postmaster, then starts up my
> >application server. I haven't run into any problems yet, but just to be
> >sure, I thought I'd ask:
> >
> >Once your script comes back from running postmaster, is pg completely ready
> >to receive connections (IP), or is there some unknown amount of time that
> >will pass before it will be ready? The postmater docs didn't seem to
> >indicate that once you run it, it is absolutely ready for connections.
> >
> >Thanks!
> >
> >--
> >Matt Mello
> >
> >
> >---------------------------(end of broadcast)---------------------------
> >TIP 1: subscribe and unsubscribe commands go to majordomo(at)postgresql(dot)org
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
> (send "unregister YourEmailAddressHere" to majordomo(at)postgresql(dot)org)

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message scott.marlowe 2003-04-14 15:17:41 Re: Index information and log disable...
Previous Message Michiel Lange 2003-04-13 01:15:07 Re: When is postmaster ready?