Boris,

Nice to discuss this with someone who understands the numerous (and various)
options of 'sar' :)  I use 'sar -r' to cross verify the 'rate of need for
swap' - a sudden increase may mean either bursts of I/O (eating up File
buffer space), memory leaks or a sudden rush of programs.... Could you take
a quick snapshot of the top 20 CPU consumers using the script below when the
snapshot runs? It takes the SID as a parameter to grep out only Oracle
processes for that SID. The interesting part is that the CPUTIME *and*
ELAPSED time is shown - you should run the snapshot as a script (as in
sqlplus perfstat/**** @snapshot.sql) where snapshot.sql has an execute,
followed by an exit. This way, one has a crude set of CPU and Elapsed time
for that process as it runs...

I use this to quickly point out processes that are heavy and consistent CPU
consumers, allowing me to rap some knuckles ;-)

#!/bin/ksh
#
#  Name:      top20.ksh
#  Purpose:   Display the top 20 CPU consumers. Specify a SID to collect
#             only those top procs related to that SID in a multi-db system
#  Author:    John Kanagaraj, DBSoft Inc/ Aug 2001
#  Notes:     Tested and works on Solaris - may need adjustment for other OS
#
uptime
echo "PID   %CPU    RUSER     CPUTIME     ELAPSED COMMAND"
if [ $# == 1 ]; then
        ps -eo pid,pcpu,ruser,time,etime,args | grep $1 | sort -nr +1  |
head -20 | awk '{print substr($0,1,80)}'
else
        ps -eo pid,pcpu,ruser,time,etime,args | sort -nr +1  | head -20 |
awk '{print substr($0,1,80)}'
fi

John Kanagaraj
Oracle Applications DBA
DBSoft Inc
(W): 408-970-7002

Great, uplifting music - http://www.klove.com

** The opinions and statements above are entirely my own and not those of my
employer or clients **


> -----Original Message-----
> From: Boris Dali [mailto:[EMAIL PROTECTED]
> Sent: Friday, June 06, 2003 3:05 PM
> To: Multiple recipients of list ORACLE-L
> Subject: RE: statspack snapshots cause 3-4 sec of 100% CPU utilization
> 
> 
> Thanks, John.
> 
> No there's no paging/swapping going on (1GB real
> memory for a single 200MB SGA and just a couple of
> users). 
> 
> Out of curiousity, John. I usually measure paging via
> vmstat (si/so columns on Linux and pi/po everywhere
> else - "everywhere else" being HP-UX, Solaris and
> AIX), as well as via sar -w (swpin/s, swpot/s) on
> HP-UX/Solaris and sar -W on Linux (pswpin/s,
> pswpot/s).
> 
> Is sar -r a better way? 
> 
> Quick check shows that on Linux it seems to report
> memory and swap utilization (but not in terms of
> rates, rather absolute numbers). On HP-UX it doesn't
> seem to be covered by man pages, but effectively the
> output is the same as -w. On Solaris it shows "unused
> memory pages and disk blocks". And I don't currently
> have any IBM boxes around
> 
> 
> As for the wrong bucket... well, I'll be able to
> verify it in the next couple of weeks on Solaris and
> for sure on HP-UX. One thing I know is that both
> vmstat and sar -u agree here on Mandrake that it is
> the kernel-mode that chews up most of the CPU for this
> 3-4 sec snapshot time.
> 
> Thanks,
> Boris Dali.
> 
> 
>  --- John Kanagaraj <[EMAIL PROTECTED]> wrote: >
> Boris,
> > 
> > I missed the second part of your question...
> > apologies. If your SGA/Shared
> > pool was partly swapped out, I would assume that you
> > might see an increased
> > 'system' utilization. Did you check 'sar -q' and
> > 'sar -r' at the same time
> > to check? I haven't used mandrake - just wondering
> > if the CPU cycles used
> > for memory access are being counted against the
> > wrong pigeonhole..
> > 
> > John Kanagaraj
> > Oracle Applications DBA
> > DBSoft Inc
> > (W): 408-970-7002
> > 
> > Grace - Getting something we don't deserve; Mercy -
> > NOT getting something we
> > deserve
> > Click on 'http://www.needhim.org' for Grace and
> > Mercy that is freely
> > available!
> > 
> > ** The opinions and statements above are entirely my
> > own and not those of my
> > employer or clients **
> 
> ______________________________________________________________
> ________ 
> Post your free ad now! http://personals.yahoo.ca
> -- 
> Please see the official ORACLE-L FAQ: http://www.orafaq.net
> -- 
> Author: Boris Dali
>   INET: [EMAIL PROTECTED]
> 
> Fat City Network Services    -- 858-538-5051 http://www.fatcity.com
> San Diego, California        -- Mailing list and web hosting services
> ---------------------------------------------------------------------
> To REMOVE yourself from this mailing list, send an E-Mail message
> to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
> the message BODY, include a line containing: UNSUB ORACLE-L
> (or the name of mailing list you want to be removed from).  You may
> also send the HELP command for other information (like subscribing).
> 
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: John Kanagaraj
  INET: [EMAIL PROTECTED]

Fat City Network Services    -- 858-538-5051 http://www.fatcity.com
San Diego, California        -- Mailing list and web hosting services
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).

Reply via email to