Thread: monitoring database activity on solaris

monitoring database activity on solaris

From
"David Parker"
Date:
According to the 7.4 doc section on monitoring database activity, one should be able to see the current activity happening in a given postgres process. It mentions that on Solaris (which we are running on) you need to use /usr/ucb/ps, and it also says
 
" your original invocation of the postmaster command must have a shorter ps status display than that provided by each server process "
 
All I seem to get in my ps is the full postmaster command with all its invocation parameters, and I don't see the postgres process itself. I can't seem to get that full path + parameters out of the postmaster display, if that is even the problem....
 
I realize that this might be more a Solaris question than a postgres one, but we have a recurring situation where we have a lot of processes chewing up cpu long after all clients have gone away, and that process display would help a great deal! I'd be grateful to anybody running Solaris for any advice.
 
Thanks.

- DAP
----------------------------------------------------------------------------------
David Parker    Tazz Networks    (401) 709-5130
 

 

Re: monitoring database activity on solaris

From
Tom Lane
Date:
"David Parker" <dparker@tazznetworks.com> writes:
> According to the 7.4 doc section on monitoring database activity, one
> should be able to see the current activity happening in a given postgres
> process. It mentions that on Solaris (which we are running on) you need
> to use /usr/ucb/ps, and it also says
>
> " your original invocation of the postmaster command must have a shorter
> ps status display than that provided by each server process "

Yeah.  This is a Solaris peculiarity that we only figured out by chance.
The best bet is to make sure that your postmaster start script invokes
the postmaster as
    postmaster
no more.  No path (set PATH beforehand instead).  No command-line
switches (whatever you might want there can be put into postgresql.conf
instead).  Redirection is OK, but keep the command line itself to a
minimum.  "postmaster" and nothing else will be shorter than any of the
ps display settings the postmaster's children use ... but if you have a
bunch of command-line arguments, it'll be longer, and Solaris' ps will
choose to display the wrong thing.

            regards, tom lane

Re: monitoring database activity on solaris

From
"David Parker"
Date:
OK, thanks. We're using pg_ctl to start it at the moment, but we can
obviously change that.

- DAP

>-----Original Message-----
>From: Tom Lane [mailto:tgl@sss.pgh.pa.us]
>Sent: Wednesday, April 06, 2005 6:18 PM
>To: David Parker
>Cc: postgres general
>Subject: Re: [GENERAL] monitoring database activity on solaris
>
>"David Parker" <dparker@tazznetworks.com> writes:
>> According to the 7.4 doc section on monitoring database
>activity, one
>> should be able to see the current activity happening in a given
>> postgres process. It mentions that on Solaris (which we are running
>> on) you need to use /usr/ucb/ps, and it also says
>>
>> " your original invocation of the postmaster command must have a
>> shorter ps status display than that provided by each server process "
>
>Yeah.  This is a Solaris peculiarity that we only figured out
>by chance.
>The best bet is to make sure that your postmaster start script
>invokes the postmaster as
>    postmaster
>no more.  No path (set PATH beforehand instead).  No
>command-line switches (whatever you might want there can be
>put into postgresql.conf instead).  Redirection is OK, but
>keep the command line itself to a minimum.  "postmaster" and
>nothing else will be shorter than any of the ps display
>settings the postmaster's children use ... but if you have a
>bunch of command-line arguments, it'll be longer, and Solaris'
>ps will choose to display the wrong thing.
>
>            regards, tom lane
>

Re: monitoring database activity on solaris

From
Tom Lane
Date:
"David Parker" <dparker@tazznetworks.com> writes:
>> The best bet is to make sure that your postmaster start script
>> invokes the postmaster as
>>     postmaster
>> no more.  No path (set PATH beforehand instead).  No
>> command-line switches (whatever you might want there can be
>> put into postgresql.conf instead).

> OK, thanks. We're using pg_ctl to start it at the moment, but we can
> obviously change that.

Hmm.  Seems like it might be worthwhile to modify pg_ctl to use PATH
and PGDATA instead of making the command line longer.  AFAIR it doesn't
insist on putting in any command-line switches except -D, and that's
easily replaced ...

            regards, tom lane

Re: monitoring database activity on solaris

From
Bruce Momjian
Date:
Tom Lane wrote:
> "David Parker" <dparker@tazznetworks.com> writes:
> >> The best bet is to make sure that your postmaster start script
> >> invokes the postmaster as
> >>     postmaster
> >> no more.  No path (set PATH beforehand instead).  No
> >> command-line switches (whatever you might want there can be
> >> put into postgresql.conf instead).
>
> > OK, thanks. We're using pg_ctl to start it at the moment, but we can
> > obviously change that.
>
> Hmm.  Seems like it might be worthwhile to modify pg_ctl to use PATH
> and PGDATA instead of making the command line longer.  AFAIR it doesn't
> insist on putting in any command-line switches except -D, and that's
> easily replaced ...

People like the long postmaster line because it allows them to see the
data path for multiple postmasters.  I think we just have to access
Solaris as partially broken, unless we want to do this only on Solaris.

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073