Saturday, March 07, 2009

jprof tool





jprof  is the  IBM Proprietary tool for analysing the performance of the JAVA Application.

it gives in-depth analysis of the method entry exit of a object , it gives the lucid picture memory leaks  , so easy to pin-point the problem which object is the cause for memory leaks 

after installing jprof tool , to generate run time logs and analysis of the logs using mx-view is explained below 


1) make sure linux source code is present in /usr/src directory of the Node machine

2) edit the file   /etc/grub.conf

 kernel /vmlinuz-2.6.18-92.el5 ro root=LABEL=/ rhgb quiet clock=tsc

After Installation 

change the generic JVM argument to 
" -agentlib:jprof=callflow,delay_start,logpath=/opt/jprof/xdms -Xgc:noAdaptiveTenure,tenureAge=8,stdGlobalCompactToSatisfyAllocate -Xgcpolicy:gencon -Xconcurrentlevel1"


copy all the *.so files from  cd /opt/jprof/xdms/  to "/opt/IBM/WebSphere6/AppServer/java/jre/bin"


cd /opt/Dpiperf/bin/

run the following command before starting the Node

 cd /opt/Dpiperf/bin/
 
  . setrunenv

 cd ../
  
 ./tinstall.appl

Now start the Cluster , after it starts check the jprof logs 

cd /opt/jprof/xdms directory 

log-msg_16699 where 16699 is the pid of Appserver


Execution of jprof:


CNSIP Service:

1) Ramp up the system by sending sipp requests (in ramp up manner ) up to 60 sec until cpu reaches 85-90% , pump the requests with 85-90% cpu  for 5 minutes with 120 tps , then bring the load back to  
15 tps, now the cpu also comes down to 10% wait for 1 minute 

now cd /opt/jprof/xdms

run the following command
 
rtdriver -l -c start 10 -c flush 30

10 represents duration of the rtdriver execution period

30 represents the flush time of buffer

Note:  some times it won't give all the thread details correctly , so vary the flush time(15 sec or 30 sec..).

output of the file is log-rt.1_18084 (cd /opt/jprof/xdms )where rt means runtime


there is some bug in the jprof tool it won't give user cpu% utilisation as 0.0%
(top or nmon)

so to know the correct cpu utilisation 

cd /opt/Dpiperf/bin

run the following command

swtrace ai 5


busy= usr+sys+wait



to analyse rt.log we need to use "mxview" graphical tool

so run xmanager before and export DISPLAY=ipaddress:0.0

run the following command 

java /opt/Dpiperf/bin/mxview.jar

once it opens , File->open

select the path of log-rt.1_18084 log for which you want to analyse




snapshot of mxview

7.78 and 7.72 ... represents the threads which are driving more cpu , so we need to track down the tree until bottom to find the thread which using more resources


it gives the thread details in the right hand side




ls -l /opt/jprof/xdms

. ./setrunenv

arcf -Ft /opt/jprof/xdms/log-rt.1_19443

arcf -t mtreeN BASE -F /opt/jprof/xdms/log-rt.1_19443

-bash-3.2# arcf -t mtreeN BASE -F /opt/jprof/xdms/log-rt.1_19443

 ARCFLOW 05.00.00

  (Built    : Tue Mar  3 22:09:55 IST 2009)

  (Source   : Thu Jan 15 10:00:00 Central Daylight Time 2009)

  (Platform : Linux-x86)


xtree is created in cd /opt/Dpiperf/bin/



now open the xtree with " mxview "



Popular Posts