postmaster restart on a different dataDir

postmaster restart on a different dataDir

am 14.08.2007 01:05:37 von Medi Montaseri

------=_Part_48889_25317090.1187046337139
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

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

------=_Part_48889_25317090.1187046337139
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

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


------=_Part_48889_25317090.1187046337139--

Re: postmaster restart on a different dataDir

am 15.08.2007 00:01:51 von decibel

--CEUtFxTsmBsHRLs3
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Mon, Aug 13, 2007 at 04:05:37PM -0700, Medi Montaseri wrote:
> Hi,
>=20
> 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.
>=20
> If I just say
> time pg_ctl restart -D /tmp/d2
> it will not produce an accurate result because pg_ctl will start postmast=
er
> 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 )
>=20
> 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.
--=20
Decibel!, aka Jim Nasby decibel@decibel.org
EnterpriseDB http://enterprisedb.com 512.569.9461 (cell)

--CEUtFxTsmBsHRLs3
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.3 (FreeBSD)

iD8DBQFGwiZPdO30qud8SkgRAkoZAJ9TKwAoXzrOTKu/T8q5saNmchRBUwCg um5E
mWBNPBcGWt4XfdSRqfndZv4=
=QgHD
-----END PGP SIGNATURE-----

--CEUtFxTsmBsHRLs3--

Re: postmaster restart on a different dataDir

am 15.08.2007 00:44:14 von Medi Montaseri

------=_Part_62730_25990911.1187131454708
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

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! 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)
>
>

------=_Part_62730_25990911.1187131454708
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

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! <> 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                        
EnterpriseDB      
http://enterprisedb.com
      512.569.9461 (cell)




------=_Part_62730_25990911.1187131454708--