Troubleshooting
Problem
System related information during performance testing
Symptom
PART: ALL PRODUCTS
During trouble shooting a performance issue at times
we need some system related information (like ps, iostat, prstat reports) at
regular time interval during the performance testing. For this we can use the
following script and put it in a cron job to get triggered at specified time
intervals.
Cause
Resolving The Problem
--- Script Begin ---
#! /bin/ksh
echo Date: `date`
echo Date:
`date +%H:%M:%S` > /tmp/$$
case $(uname) in
SunOS) ps -eo
pid,ppid,time,etime,args >> /tmp/$$
;;
AIX) ps -eo
pid,ppid,time,etime,thcount,scount,args >> /tmp/$$
;;
Linux) ps -eo
pid,ppid,time,etime,thcount,scount,args >> /tmp/$$
;;
HP-UX) export
UNIX95=1; ps -eo pid,ppid,time,etime,args >> /tmp/$$
;;
*) exit
;;
esac
FILE="/users/dcm/ps-`uname -n`-`date +%d`"
#echo
$FILE
echo ================================ >> $FILE
cat /tmp/$$ |
awk '/^Date:/ {D=$2} {print D, " ", $0}' >> $FILE
rm /tmp/$$
---
Script End ---
Some pointers for this
script:
--------------------------------------------
This will
generate reports specific to OS. For different reports just change the
appropriate command (like "iostat" instead of "ps -eo..."). This script saves
the reports under $FILE folder.
This script will run periodically and
dump data into a file under a specified directory. This needs to be changed
before deploying & running the script. It can be changed in the "FILE"
variable. Just change the first 2 directory entries, don't change the actual
file name starting with "ps-".
The script will need to be placed in the
cron to run every 5-6 minutes. Don't need to run more frequently. Ensure that
you have sufficient space wherever you decide to dump the output of this
script.
Depending on the # of processes running, the output can be large.
Please beware that workloads that start up for short periods of time and
stop repeatedly may not be captured by this script even though they may use
quite a bit of CPU.
Historical Number
PRI49745
Product Synonym
[<p><b>]Fact[</b><p>];
Was this topic helpful?
Document Information
Modified date:
16 June 2018
UID
swg21538399