Обсуждение: pgmonitor and Solaris
I believe I have found the cause of the pgmonitor problem on Solaris. pgmonitor assumes you have a working 'ps' status display, which shows user/database/connection, and query type. I have learned from a Great Bridge employee that his Solaris box is not updating the ps display for 7.1beta, and I assume the same trouble exists for 7.0.3. Can someone confirm that 'ps' status display doesn't work on Solaris, and if it doesn't, can someone come up with a fix that we can put into 7.1.1? You can look in /pg/backend/utils/misc/ps_status.c for all the ps status code. It has many options for ps status updating. Thanks. -- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610) 853-3000 + If your life is a hard drive, | 830 Blythe Avenue + Christ can be your backup. | Drexel Hill, Pennsylvania 19026
Bruce Momjian writes: > Can someone confirm that 'ps' status display doesn't work on Solaris, You may need to use /usr/ucb/ps. Last I checked there was no way to change the display of /usr/bin/ps. -- Peter Eisentraut peter_e@gmx.net http://yi.org/peter-e/
> Bruce Momjian writes: > > > Can someone confirm that 'ps' status display doesn't work on Solaris, > > You may need to use /usr/ucb/ps. Last I checked there was no way to > change the display of /usr/bin/ps. I can do that, but I am told that /usr/ucb/ps does not allow me to restrict the display to a specific user. Without that, ps shows all processes, which is pretty slow to run regularly, no? Can you check for a user restriction on /usr/ucb/ps. I can certainly code in a check for its existance and use that instead. Does 'ps' status display work with PostgreSQL and /usr/ucb/ps? Let me know. Thanks. -- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610) 853-3000 + If your life is a hard drive, | 830 Blythe Avenue + Christ can be your backup. | Drexel Hill, Pennsylvania 19026
whats wrong with /usr/ucb/ps auxw | grep $PGUSER to get only the processes for PG? LER -- Larry Rosenman http://www.lerctr.org/~ler/ Phone: +1 972 414 9812 E-Mail: ler@lerctr.org US Mail: 1905 Steamboat Springs Drive, Garland, TX 75044-6749 US >>>>>>>>>>>>>>>>>> Original Message <<<<<<<<<<<<<<<<<< On 3/28/01, 3:31:08 PM, Bruce Momjian <pgman@candle.pha.pa.us> wrote regarding [HACKERS] Re: [PORTS] pgmonitor and Solaris: > > Bruce Momjian writes: > > > > > Can someone confirm that 'ps' status display doesn't work on Solaris, > > > > You may need to use /usr/ucb/ps. Last I checked there was no way to > > change the display of /usr/bin/ps. > I can do that, but I am told that /usr/ucb/ps does not allow me to > restrict the display to a specific user. Without that, ps shows all > processes, which is pretty slow to run regularly, no? Can you check for > a user restriction on /usr/ucb/ps. I can certainly code in a check for > its existance and use that instead. > Does 'ps' status display work with PostgreSQL and /usr/ucb/ps? > Let me know. Thanks. > -- > Bruce Momjian | http://candle.pha.pa.us > pgman@candle.pha.pa.us | (610) 853-3000 > + If your life is a hard drive, | 830 Blythe Avenue > + Christ can be your backup. | Drexel Hill, Pennsylvania 19026 > ---------------------------(end of broadcast)--------------------------- > TIP 4: Don't 'kill -9' the postmaster
[ Charset ISO-8859-1 unsupported, converting... ] > whats wrong with /usr/ucb/ps auxw | grep $PGUSER > > to get only the processes for PG? I can do that if there is no other option, but on my BSDI machine, restricting ps to a specific user is much faster than a ps on the whole system. Seeing that 'ps' is run by default every 5 seconds, this could be a performance issue. If I have to use 'grep' I will, but I was hoping for a real user restriction. -- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610) 853-3000 + If your life is a hard drive, | 830 Blythe Avenue + Christ can be your backup. | Drexel Hill, Pennsylvania 19026
On Wed, Mar 28, 2001 at 04:56:15PM -0500, Bruce Momjian allegedly wrote:
> [ Charset ISO-8859-1 unsupported, converting... ]
> > whats wrong with /usr/ucb/ps auxw | grep $PGUSER
> >
> > to get only the processes for PG?
>
> I can do that if there is no other option, but on my BSDI machine,
> restricting ps to a specific user is much faster than a ps on the whole
> system. Seeing that 'ps' is run by default every 5 seconds, this could
> be a performance issue.
>
> If I have to use 'grep' I will, but I was hoping for a real user
> restriction.
How about the following:
ilsefe2:~$ /usr/ucb/ps -aux|head -1
USER PID %CPU %MEM SZ RSS TT S START TIME COMMAND
Broken Pipe
ilsefe2:~$ /usr/ucb/ps -aux|grep mathijs
mathijs 7255 0.1 0.2 2432 1816 pts/0 S 00:12:41 0:00 -bash
mathijs 7775 0.1 0.1 960 728 pts/0 S 00:24:29 0:00 grep mathijs
mathijs 7344 0.0 0.1 1064 912 pts/0 T 00:14:56 0:00 man ps
mathijs 7359 0.0 0.1 1040 808 pts/0 T 00:14:57 0:00 sh -c more -s /tmp
mathijs 7360 0.0 0.1 1184 968 pts/0 T 00:14:57 0:00 more -s /tmp/mp3Ha
ilsefe2:~$ ps -U mathijs -o user,pid,pcpu,pmem,vsz,rss,tty,s,stime=START -o time,comm
USER PID %CPU %MEM VSZ RSS TT S START TIME COMMAND
mathijs 7359 0.0 0.1 1040 808 pts/0 T 00:14:57 0:00 sh
mathijs 7255 0.1 0.2 2432 1816 pts/0 S 00:12:41 0:00 -bash
root 7816 0.1 0.1 1080 840 pts/0 O 00:28:13 0:00 ps
mathijs 7344 0.0 0.1 1064 912 pts/0 T 00:14:56 0:00 man
mathijs 7360 0.0 0.1 1184 968 pts/0 T 00:14:57 0:00 more
It doesn't use any extra extra programs, nor the somewhat deprecated /usr/ucb/ps
command. The only problem I see may be the alignment of some fields. The ps
command itself is listed because the user mathijs was running it...
Regards,
Mathijs
--
It's not that perl programmers are idiots, it's that the language
rewards idiotic behavior in a way that no other language or tool has
ever done.
Erik Naggum
On Thu, Mar 29, 2001 at 12:30:06AM +0200, Mathijs Brands allegedly wrote:
> On Wed, Mar 28, 2001 at 04:56:15PM -0500, Bruce Momjian allegedly wrote:
> > [ Charset ISO-8859-1 unsupported, converting... ]
> > > whats wrong with /usr/ucb/ps auxw | grep $PGUSER
> > >
> > > to get only the processes for PG?
> >
> > I can do that if there is no other option, but on my BSDI machine,
> > restricting ps to a specific user is much faster than a ps on the whole
> > system. Seeing that 'ps' is run by default every 5 seconds, this could
> > be a performance issue.
> >
> > If I have to use 'grep' I will, but I was hoping for a real user
> > restriction.
>
> How about the following:
>
> ilsefe2:~$ /usr/ucb/ps -aux|head -1
> USER PID %CPU %MEM SZ RSS TT S START TIME COMMAND
> Broken Pipe
> ilsefe2:~$ /usr/ucb/ps -aux|grep mathijs
> mathijs 7255 0.1 0.2 2432 1816 pts/0 S 00:12:41 0:00 -bash
> mathijs 7775 0.1 0.1 960 728 pts/0 S 00:24:29 0:00 grep mathijs
> mathijs 7344 0.0 0.1 1064 912 pts/0 T 00:14:56 0:00 man ps
> mathijs 7359 0.0 0.1 1040 808 pts/0 T 00:14:57 0:00 sh -c more -s /tmp
> mathijs 7360 0.0 0.1 1184 968 pts/0 T 00:14:57 0:00 more -s /tmp/mp3Ha
> ilsefe2:~$ ps -U mathijs -o user,pid,pcpu,pmem,vsz,rss,tty,s,stime=START -o time,comm
> USER PID %CPU %MEM VSZ RSS TT S START TIME COMMAND
> mathijs 7359 0.0 0.1 1040 808 pts/0 T 00:14:57 0:00 sh
> mathijs 7255 0.1 0.2 2432 1816 pts/0 S 00:12:41 0:00 -bash
> root 7816 0.1 0.1 1080 840 pts/0 O 00:28:13 0:00 ps
> mathijs 7344 0.0 0.1 1064 912 pts/0 T 00:14:56 0:00 man
> mathijs 7360 0.0 0.1 1184 968 pts/0 T 00:14:57 0:00 more
Damn! Small correction:
ps -U mathijs -o user,pid,pcpu,pmem,vsz=SZ -o rss,tty,s,stime=START -o time,comm
Mathijs
--
It's not that perl programmers are idiots, it's that the language
rewards idiotic behavior in a way that no other language or tool has
ever done.
Erik Naggum