Received: from postgresql.org.org (webmail.postgresql.org [216.126.85.28]) by postgresql.org (8.11.3/8.11.1) with SMTP id f2UEZAK53301 for ; Fri, 30 Mar 2001 09:35:10 -0500 (EST) (envelope-from pgsql-admin-owner@postgresql.org) Received: from serv1.ilse.nl (serv1.ilse.nl [212.189.131.11]) by mail.postgresql.org (8.11.3/8.11.1) with ESMTP id f2SMUDU08632; Wed, 28 Mar 2001 17:30:14 -0500 (EST) (envelope-from mathijs@serv0.ilse.nl) Received: from serv0.ilse.nl (intra.ilse.nl [10.1.8.249]) by serv1.ilse.nl (8.11.0/8.10.2) with ESMTP id f2SMUA798770; Thu, 29 Mar 2001 00:30:10 +0200 (MEST) Received: (from mathijs@localhost) by serv0.ilse.nl (8.11.1/8.11.1) id f2SMU6d26710; Thu, 29 Mar 2001 00:30:06 +0200 (CEST) (envelope-from mathijs) Date: Thu, 29 Mar 2001 00:30:06 +0200 From: Mathijs Brands To: Bruce Momjian Cc: Larry Rosenman , Peter Eisentraut , PostgreSQL-development , PostgreSQL-ports , PostgreSQL-Admin Subject: Re: [HACKERS] Re: [PORTS] pgmonitor and Solaris Message-ID: <20010329003006.A26435@ilse.nl> References: <20010328.21515000@ler-freebie.iadfw.net> <200103282156.QAA20902@candle.pha.pa.us> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <200103282156.QAA20902@candle.pha.pa.us>; from pgman@candle.pha.pa.us on Wed, Mar 28, 2001 at 04:56:15PM -0500 X-Unexpected-Header: The Spanish Inquisition X-Archive-Number: 200103/259 X-Sequence-Number: 1109 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