Operating System - HP-UX
1834935 Members
2479 Online
110071 Solutions
New Discussion

Re: monitoring CPU and Memory usage for application processes

 
SOLVED
Go to solution
sheevm
Regular Advisor

monitoring CPU and Memory usage for application processes

Hi All,

We are conducting UAT for one of the application to be soon deployed to production.

I need to monitor the CPU and Memory usage for this application processes when UAT is going on.

Anyone out there give me some tips?

Is there way to run top command in a script and send the output to a file?

Any tips are appreciated.

HP-UX 11.23.
be good and do good
3 REPLIES 3
Geoff Wild
Honored Contributor
Solution

Re: monitoring CPU and Memory usage for application processes

top -d 1 -f /path/to/somefilename.out

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Geoff Wild
Honored Contributor

Re: monitoring CPU and Memory usage for application processes

Here's some other scripts that you may want to use:

# cat /usr/local/bin/usermem
#!/bin/ksh
# usermem - display memory claimed by a user
#
if [ $# -lt 1 -o \( $# -gt 1 -a $# -lt 4 \) ]
then
echo "Usage:"
echo "usermem \"userid\""
echo "Example:"
echo "usermem gwild"
exit 1
fi
echo " "

USER=$1
t=0
for j in `UNIX95= ps -e -o vsz=Kbytes -o ruser -o pid,args=Command-Line | sort -rnk1 | grep -v Kbytes | grep " $USER " | awk '{print $1}'`
do
t=`expr $t + $j`
done
echo "\nMemory claimed by $USER: $t Kbytes.\n"


Attached is the c source for memdetail - just compile with the built in hp compiler...


Also, I use mwa to collect info...


From root's cron:

# performance
55 23 * * 1-5 /opt/perf/bin/extract -xp -r /home/gwild/zgbltemplate -g -b today 7:00 -e today 18:00 -f stdout | /bin/mailx -s 'SAP Server performance report' sysadm >/dev/null 2>&1


# cat /home/gwild/zgbltemplate
REPORT "MWA Export on !SYSTEM_ID"
FORMAT ASCII
HEADINGS ON
SEPARATOR="|"
SUMMARY=60
MISSING=0
DATA TYPE GLOBAL
YEAR
DATE
TIME
GBL_CPU_TOTAL_UTIL
GBL_CPU_SYS_MODE_UTIL
GBL_CPU_USER_MODE_UTIL
GBL_CPU_SYSCALL_UTIL
GBL_CPU_INTERRUPT_UTIL
GBL_PRI_QUEUE
GBL_CPU_CSWITCH_UTIL
GBL_SWAP_SPACE_UTIL
GBL_DISK_UTIL_PEAK
GBL_DISK_SUBSYSTEM_QUEUE
GBL_MEM_UTIL
GBL_MEM_CACHE_HIT_PCT
GBL_MEM_PAGEOUT_RATE
GBL_MEM_SWAPOUT_RATE
GBL_MEM_QUEUE
GBL_NET_PACKET_RATE
GBL_NET_OUTQUEUE
GBL_NETWORK_SUBSYSTEM_QUEUE



Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.