solaris and ps

Started by Leonardo Francalanciover 21 years ago6 messagesgeneral
Jump to latest
#1Leonardo Francalanci
lfrancalanci@simtel.ie

I read "Chapter 23. Monitoring Database Activity" to monitor postgresql,
but on Solaris it doesn't work. I tried "/usr/ucb/ps", but it doesn't
work either (I only see the postmaster startup parameters). Isn't there
any other solution to see what postgresql instances are doing?

#2Richard Huxton
dev@archonet.com
In reply to: Leonardo Francalanci (#1)
Re: solaris and ps

Leonardo Francalanci wrote:

I read "Chapter 23. Monitoring Database Activity" to monitor postgresql,
but on Solaris it doesn't work. I tried "/usr/ucb/ps", but it doesn't
work either (I only see the postmaster startup parameters). Isn't there
any other solution to see what postgresql instances are doing?

If the tips on solaris ps haven't helped, you can turn on statistics
gathering and check pg_stat_activity.

--
Richard Huxton
Archonet Ltd

#3Michael Fuhr
mike@fuhr.org
In reply to: Richard Huxton (#2)
Re: solaris and ps

On Thu, Oct 14, 2004 at 11:14:10AM +0100, Richard Huxton wrote:

Leonardo Francalanci wrote:

I read "Chapter 23. Monitoring Database Activity" to monitor postgresql,
but on Solaris it doesn't work. I tried "/usr/ucb/ps", but it doesn't
work either (I only see the postmaster startup parameters). Isn't there
any other solution to see what postgresql instances are doing?

If the tips on solaris ps haven't helped, you can turn on statistics
gathering and check pg_stat_activity.

pargs should work, but you'll probably have to run it as the postgres
user or as root or you'll get "cannot examine <pid>: permission denied".

pargs `/usr/bin/ps -opid -Upostgres | tail +2`

I just did some tests on Solaris 9 and, curiously, whether /usr/ucb/ps
shows the altered argument list or not appears to depend on the
lengths of the original and replacement arguments:

% ./foo x
PID TT S TIME COMMAND
28106 pts/2 S 0:00 baz qux

% ./foo xy
PID TT S TIME COMMAND
28109 pts/2 S 0:00 ./foo xy

As far as I can tell, for /usr/ucb/ps the show the replacement
arguments, the sum of the lengths of the replacement arguments
must be 2 or more greater than the sum of the lengths of the
original arguments. I'm guessing that if the postmaster used
a longer status message, then /usr/ucb/ps would show it. I'll
test that the next time I rebuild PostgreSQL.

--
Michael Fuhr
http://www.fuhr.org/~mfuhr/

#4Michael Fuhr
mike@fuhr.org
In reply to: Michael Fuhr (#3)
Re: solaris and ps

On Thu, Oct 14, 2004 at 08:24:19AM -0600, Michael Fuhr wrote:

As far as I can tell, for /usr/ucb/ps the show the replacement
arguments, the sum of the lengths of the replacement arguments
must be 2 or more greater than the sum of the lengths of the
original arguments. I'm guessing that if the postmaster used
a longer status message, then /usr/ucb/ps would show it.

I just noticed that this is already mentioned in the PostgreSQL
documentation:

"In addition, your original invocation of the postmaster command
must have a shorter ps status display than that provided by each
server process."

--
Michael Fuhr
http://www.fuhr.org/~mfuhr/

#5Leonardo Francalanci
lfrancalanci@simtel.ie
In reply to: Michael Fuhr (#4)
Re: solaris and ps

"In addition, your original invocation of the postmaster command
must have a shorter ps status display than that provided by each
server process."

Yes, using PGDATA instead of the whole path eith the -D option worked:
now I can see the different status displays.

#6Andrew Sullivan
ajs@crankycanuck.ca
In reply to: Leonardo Francalanci (#1)
Re: solaris and ps

On Thu, Oct 14, 2004 at 11:16:48AM +0200, Leonardo Francalanci wrote:

I read "Chapter 23. Monitoring Database Activity" to monitor postgresql,
but on Solaris it doesn't work. I tried "/usr/ucb/ps", but it doesn't
work either (I only see the postmaster startup parameters). Isn't there
any other solution to see what postgresql instances are doing?

/usr/ucb/ps -auxww will work. I've used it thousands of times.

A

--
Andrew Sullivan | ajs@crankycanuck.ca
The fact that technology doesn't work is no bar to success in the marketplace.
--Philip Greenspun