pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feedpostmaster restart on a different dataDir
3+ messages / 2 participants
[nested] [flat]
* postmaster restart on a different dataDir
@ 2007-08-13 23:05 Medi Montaseri <montaseri@gmail.com>
0 siblings, 1 reply; 3+ messages in thread
From: Medi Montaseri @ 2007-08-13 23:05 UTC (permalink / raw)
To: pgsql-admin
Hi,
I am trying to measure startup time of postmaster. Say I have postmaster
running on -D /tmp/d1 and would like to restart it on -D /tmp/d2.
If I just say
time pg_ctl restart -D /tmp/d2
it will not produce an accurate result because pg_ctl will start postmaster
in the background and return immediately but if you query the engine right
away, you'll see that it is not ready yet as in
time ( pg_ctl restart -D /tmp/d2 ; psql -l )
If I call postmaster, then the command is blocking waiting for postmaster to
exit.
I am sure there is a way...but I figured I ask my good friends first...
Thanks
Medi
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: postmaster restart on a different dataDir
@ 2007-08-14 22:01 Decibel! <decibel@decibel.org>
parent: Medi Montaseri <montaseri@gmail.com>
0 siblings, 1 reply; 3+ messages in thread
From: Decibel! @ 2007-08-14 22:01 UTC (permalink / raw)
To: Medi Montaseri <montaseri@gmail.com>; +Cc: pgsql-admin
On Mon, Aug 13, 2007 at 04:05:37PM -0700, Medi Montaseri wrote:
> Hi,
>
> I am trying to measure startup time of postmaster. Say I have postmaster
Why?
> running on -D /tmp/d1 and would like to restart it on -D /tmp/d2.
>
> If I just say
> time pg_ctl restart -D /tmp/d2
> it will not produce an accurate result because pg_ctl will start postmaster
> in the background and return immediately but if you query the engine right
> away, you'll see that it is not ready yet as in
> time ( pg_ctl restart -D /tmp/d2 ; psql -l )
>
> If I call postmaster, then the command is blocking waiting for postmaster to
> exit.
So let it stop, start the timer, then start it again.
--
Decibel!, aka Jim Nasby decibel@decibel.org
EnterpriseDB http://enterprisedb.com 512.569.9461 (cell)
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: postmaster restart on a different dataDir
@ 2007-08-14 22:44 Medi Montaseri <montaseri@gmail.com>
parent: Decibel! <decibel@decibel.org>
0 siblings, 0 replies; 3+ messages in thread
From: Medi Montaseri @ 2007-08-14 22:44 UTC (permalink / raw)
To: Decibel! <decibel@decibel.org>; +Cc: pgsql-admin
Actually I found the answer....pg_ctl supports a -w switch which waits for
the start operation to complete.
Decibel...without -w, pg_ctl will return immediately before postmaster is
fully operational. If you don't believe me start the engine and try to
connect to it right away with pgsql(1)...
Cheers for now
Medi
On 8/14/07, Decibel! <decibel@decibel.org> wrote:
>
> On Mon, Aug 13, 2007 at 04:05:37PM -0700, Medi Montaseri wrote:
> > Hi,
> >
> > I am trying to measure startup time of postmaster. Say I have postmaster
>
> Why?
>
> > running on -D /tmp/d1 and would like to restart it on -D /tmp/d2.
> >
> > If I just say
> > time pg_ctl restart -D /tmp/d2
> > it will not produce an accurate result because pg_ctl will start
> postmaster
> > in the background and return immediately but if you query the engine
> right
> > away, you'll see that it is not ready yet as in
> > time ( pg_ctl restart -D /tmp/d2 ; psql -l )
> >
> > If I call postmaster, then the command is blocking waiting for
> postmaster to
> > exit.
>
> So let it stop, start the timer, then start it again.
> --
> Decibel!, aka Jim Nasby decibel@decibel.org
> EnterpriseDB http://enterprisedb.com 512.569.9461 (cell)
>
>
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2007-08-14 22:44 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2007-08-13 23:05 postmaster restart on a different dataDir Medi Montaseri <montaseri@gmail.com>
2007-08-14 22:01 ` Decibel! <decibel@decibel.org>
2007-08-14 22:44 ` Medi Montaseri <montaseri@gmail.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox