How to use GlassFish v3 DTrace probes on Solaris

Use of  Enterprise Manager DTrace Monitoring 3.0 beta value-add, exposes GlassFish v3 monitoring probes as DTrace probes on solaris platforms. D scripts can span multiple layers. In a given application, some of the modules might take too much time. You want to know how much time each module is taking so that you can quickly isolate the slow module. The following example shows the amount of time taken by each module. This can be easily extended to other modules/layers like MySQL, Solaris OS, etc. In future articles, I'll blog about this.
  • Install JDK7 and set JAVA_HOME to point to this location.
  • Download and install GlassFish v3, let us call the install location <gfv3>
  • Download DTrace value-add: DTrace Monitoring is available under an evaluation licence from the Sun GlassFish Enterprise Manager DTrace Monitoring download page.
  • cd <dtrace download directory>
  • unzip monitoring_dtrace-3_0-beta.zip
  • cp monitoring_dtrace/lib/glassfish-dtrace.jar <gfv3>/modules
  • Start GlassFish v3 using asadmin start-domain domain
  • Enable dtrace using asadmin set configs.config.server-config.monitoring-service.dtrace-enabled=true
  • Download and Deploy the sample ejb-web application using asadmin deploy stateless-converter.ear
  • In another terminal, login as super user or any user who is privileged to work with dtrace commands
  • Determine the process id (pid) for the application server (GlassFish v3) using jps -l
    munnangi[212]: jps -l
    1978 com.sun.enterprise.glassfish.bootstrap.ASMain
    2513 sun.tools.jps.Jps
  • Download and start the gfv3_web_ejb.d script using ./gfv3_web_ejb.d 1978
  • Now using browser, access the application http://localhost:8080/converter
  • You'll see the following output in dtrace terminal showing the time taken by each module.
    munnangi[213]: ./gfv3_web_ejb.d 1978
    dtrace: script './gfv3_web_ejb.d' matched 6 probes
    CPU ID FUNCTION:NAME
    1 1 :BEGIN Collecting data, press \^c to end...

    1 76185 http-service:requestStartEvent requestStartEvent
    1 76723 bean:containerEnteringEvent time taken in micro sec. = 923
    1 76724 bean:containerLeavingEvent time taken in micro sec. = 1700
    1 76723 bean:containerEnteringEvent time taken in micro sec. = 188
    1 76724 bean:containerLeavingEvent time taken in micro sec. = 1263
    1 76184 http-service:requestEndEvent time taken in micro sec. = 4364
  • From the above one can easily how much time is spent in each module.
Refer to Sun GlassFish Enterprise Manager DTrace Monitoring 3.0 Beta Installation and Quick Start Guide  for detailed instructions.

Comments:

Post a Comment:
  • HTML Syntax: NOT allowed
About

msreddy

Search

Categories
Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today