Thread: multiple postmasters

multiple postmasters

From
David Mehringer
Date:
Hi,
We're running postgresql 7.0.2 on solaris 5.7.  The admin docs say that only
one postmaster process should be running.  However, our "master" postmaster
process (PID=560 below) appears to have spawned off a couple of other
postmaster processes:

     UID   PID  PPID  C    STIME TTY      TIME CMD
 bimaadm   560     1  0   Nov 27 ?        1:24 /appl/bima/pgsql/bin/postmaster -S -i
 bimaadm 10237   560  0 17:16:53 ?        0:04 /appl/bima/pgsql/bin/postmaster -S -i
 bimaadm 10240   560  0 17:17:00 ?        0:06 /appl/bima/pgsql/bin/postmaster -S -i

Is this normal?  If not, what could be the cause of this?  Our user
interface currently processes queries using the Pg.pm perl module and the
JDBC interface.

Thanks
Dave


--
David Mehringer, Ph.D.            University of Illinois
dmehring@astro.uiuc.edu           National Center for Supercomputing
Research Scientist,               Applications/Department of Astronomy
Software Applications Developer,  1002 W. Green St.
BIMA Data Archivist               Urbana, IL 61801 USA
voice: 217 244 5468               fax: 217 244 7638
http://monet.astro.uiuc.edu/~dmehring/dmehring.html


Re: multiple postmasters

From
Peter Eisentraut
Date:
David Mehringer writes:

> We're running postgresql 7.0.2 on solaris 5.7.  The admin docs say that only
> one postmaster process should be running.

The docs are wrong in that case.  Can you name chapter and section so we
can fix it?

> However, our "master" postmaster
> process (PID=560 below) appears to have spawned off a couple of other
> postmaster processes:
>
>      UID   PID  PPID  C    STIME TTY      TIME CMD
>  bimaadm   560     1  0   Nov 27 ?        1:24 /appl/bima/pgsql/bin/postmaster -S -i
>  bimaadm 10237   560  0 17:16:53 ?        0:04 /appl/bima/pgsql/bin/postmaster -S -i
>  bimaadm 10240   560  0 17:17:00 ?        0:06 /appl/bima/pgsql/bin/postmaster -S -i
>
> Is this normal?  If not, what could be the cause of this?

Notice how the PPID (parent pid) of the second and third process refers to
the first one.  The first process is the "postmaster" you started (by init
apparently), the second and third ones got forked to handle connections.
(one process per connection)

--
Peter Eisentraut      peter_e@gmx.net       http://yi.org/peter-e/


Re: multiple postmasters

From
David Mehringer
Date:
On Wed, 10 Jan 2001, Peter Eisentraut wrote:
>
> > We're running postgresql 7.0.2 on solaris 5.7.  The admin docs say that only
> > one postmaster process should be running.
>
> The docs are wrong in that case.  Can you name chapter and section so we
> can fix it?
>
Hi,
Thanks for the quick response.  I was looking around the postgresql website
for info regarding this and came across a sentence about it.  Unfortunately,
I can not find it again.  Will let you know if I come across it in the
future.  The sentence I read may actually have meant that *the
administrator* should not start more than one postmaster process, in which
case I misinterpreted it.


--
David Mehringer, Ph.D.            University of Illinois
dmehring@astro.uiuc.edu           National Center for Supercomputing
Research Scientist,               Applications/Department of Astronomy
Software Applications Developer,  1002 W. Green St.
BIMA Data Archivist               Urbana, IL 61801 USA
voice: 217 244 5468               fax: 217 244 7638
http://monet.astro.uiuc.edu/~dmehring/dmehring.html


Re: multiple postmasters

From
"Ross J. Reedstrom"
Date:
On Wed, Jan 10, 2001 at 01:34:34PM -0600, David Mehringer wrote:
> On Wed, 10 Jan 2001, Peter Eisentraut wrote:
> >
> > > We're running postgresql 7.0.2 on solaris 5.7.  The admin docs say that only
> > > one postmaster process should be running.
> >
> > The docs are wrong in that case.  Can you name chapter and section so we
> > can fix it?
> >
> Hi,
> Thanks for the quick response.  I was looking around the postgresql website
> for info regarding this and came across a sentence about it.  Unfortunately,
> I can not find it again.  Will let you know if I come across it in the
> future.  The sentence I read may actually have meant that *the
> administrator* should not start more than one postmaster process, in which
> case I misinterpreted it.
>

Dave,
Another aspect of this problem is that, on most platforms, the children
of postmaster that are forked for each connection rename themselves
to 'postgres'. The code for this was changed, recently, due to some
potential speed, security, or portability problems (I'm not sure off
the top of my head). You may be on a platform that no longer renames,
so you'll end up with multiple processes names 'postmaster', and have
to track down which is which they way Peter pointed out.

Ross


Re: multiple postmasters

From
Peter Eisentraut
Date:
Ross J. Reedstrom writes:

> Another aspect of this problem is that, on most platforms, the children
> of postmaster that are forked for each connection rename themselves
> to 'postgres'. The code for this was changed, recently, due to some
> potential speed, security, or portability problems (I'm not sure off
> the top of my head). You may be on a platform that no longer renames,

No, the code was changed to work on more platforms, not less.  I think on
Solaris you need to use /usr/ucb/bin/ps (BSD style) rather than
/usr/bin/ps (SysV style) to see the altered information.

> so you'll end up with multiple processes names 'postmaster', and have
> to track down which is which they way Peter pointed out.

--
Peter Eisentraut      peter_e@gmx.net       http://yi.org/peter-e/