Thread: When is postmaster ready?

When is postmaster ready?

From
"Matt Mello"
Date:
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


Re: When is postmaster ready?

From
Michiel Lange
Date:
 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@postgresql.org


Re: When is postmaster ready?

From
Robert Treat
Date:
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@postgresql.org
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
>     (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)