SlideShare ist ein Scribd-Unternehmen logo
1 von 42
Downloaden Sie, um offline zu lesen
1

Thursday, September 23, 2010
<Insert Picture Here>




          Oracle Performance Measurement and Tuning with Solaris DTrace
          Jeff Savit
          Principal Sales Consultant

          Angelo Rajadurai
          Principal Software Engineer

Thursday, September 23, 2010
The following is intended to outline our general
           product direction. It is intended for information
           purposes only, and may not be incorporated into any
           contract. It is not a commitment to deliver any
           material, code, or functionality, and should not be
           relied upon in making purchasing decisions.
           The development, release, and timing of any
           features or functionality described for Oracle’s
           products remains at the sole discretion of Oracle.




                                                                 3

Thursday, September 23, 2010
Agenda


          • Basic Concepts of Performance Tuning      <Insert Picture Here>

          • Performance Tuning Features in Solaris
          • DTrace - Dynamically Observing the Entire
            Application Stack
          • Dynamic Tracing Oracle WebLogic Server with
            DTrace
          • Further Reading




                                                                    4

Thursday, September 23, 2010
Basic Concepts for Performance Management

                                Measure
                               Performance




                                             Analyze
                     Define    Performance
                                             Model &
                     Goals        Model      Deduce




                               Take Action


                                                       5

Thursday, September 23, 2010
Start with the Best Platform
          Solaris - Designed for Performance & Scale



         Dynamic, multithreaded, preemptive kernel and process model
         Tightly integrated file system and virtual memory
         64-bit kernel, supporting both 32-bit and 64-bit applications
         Resource management
         Optimized, SMP-hot network stack
         CPU and memory scalability from low to high. Today, up to:
             256 CPUs on T5440, 512 on M9000; 4TB RAM on M9000
         Optimized for modern multicore, multithread, NUMA systems
         Premier x86 support optimized for Intel Nehalem and AMD Opteron
         Solaris Containers (Zones): negligible-overhead, built in virtualization




                                                                             6

Thursday, September 23, 2010
Define the Problem

   • High system time is not a problem
      • You may be asking the system to do stuff
   • Slow I/O is not a problem
      • You may be streaming bulk I/O
   • 100% utilization is not a problem
      • You are using all the box you paid for :-)
      • Modern CPUs, NICs, disks, can do more than 1 thing at a
           time without adding delay
       •   Fine even if saturated unless some work unable to get
           enough cycles to meet SLA
   • None of these are problems unless they relate to
      business metrics

                                                                   7
Thursday, September 23, 2010
Monitor: Right Location & Tools
                                                      ruby
                          Frameworks
                                                      python
                               Presentation           php




                                                                 C++
                                                                  C
                      JSP/Javascript/Ajax/JavaFX
                                                      perl
            Container WebLogic Server                 shell


                          Database                  Apps run     Native
                                                     in VM       Apps
                               Oracle 11g

                          Operating System Solaris/OEL/Windows

                                                                     8

Thursday, September 23, 2010
Solaris Tool chest
                                                 Tracing & Debugging
                Proc tools
                                                     abitrace - trace ABI interfaces
    cputrack - per-processor hw counters              mdb – debug process/kernel
    pargs – process arguments               truss – trace function and system calls
    pflags – process flags
    pcred – process credentials
    pldd – process's library dependencies          System Statistics
    plockstat – process lock statistics
    psig – process signal disposition              acctcom – process accounting
    pstack – process stack dump                  busstat – Bus hardware counters
    pmap – process memory map                   cpustat – CPU hardware counters
                                                      iostat – IO & NFS statistics
    pfiles – open files and names
                                                   kstat – display kernel statistics
    prstat – process statistics
                                                     mpstat – processor statistics
    ptree – process tree
                                                       netstat – network statistics
    ptime – process microstate times
                                                         nfsstat – nfs server stats
    pwdx – process working directory
                                                           sar – kitchen sink utility
    pgrep – grep for processes
                                                    vmstat – virtual memory stats
    pkill – kill processes list
    pstop – stop processes
    prun – start processes                                    Toolkits
    prctl – view/set process resources
    pwait – wait for process                        DTraceToolkit – DTrace Tools
    preap – reap a zombie process                      K9Toolkit – perl perf tools
                                                          nicstat – network stats


                                                                                        9
Thursday, September 23, 2010
perfbar
          see the big picture from across the room


            Don't be shy about starting with a
            simple graphical tool!




                                              http://blogs.sun.com/partnertech/
                                              resource/tools/perfbar.{sparc,i386}

                                              See:LDOM Booth for use of perfbar


                                                                           10

Thursday, September 23, 2010
Fenxi
          Reading a 1000 lines of text does not show you the big picture


               Open source tool written at Sun
               for aggregating and displaying
               vmstat, mpstat, iostat data




                                                      https://fenxi.dev.java.net/




                                                                             11

Thursday, September 23, 2010
So why do we need another tool?




                                            12

Thursday, September 23, 2010
Observing the Stack is hard
                                                      ruby
                          Frameworks
                                                      python
                               Presentation           php




                                                                 C++
                                                                  C
                      JSP/Javascript/Ajax/JavaFX
                                                      perl
            Container WebLogic Server                 shell


                          Database                  Apps run     Native
                                                     in VM       Apps
                               Oracle 11g

                          Operating System Solaris/OEL/Windows

                                                                     13

Thursday, September 23, 2010
“M
                                                       ay
                                             m in”             D
                                                            be ata
                                     :     ad                  th bas
                                   er se                          e    e
                              e lop aba                      w i m Ad
                           ev dat                               ll idd mi
                          D                                       kn le n:
                                                                    o w wa
                           t he                                        ”  re
                         k                                                     gu
                       as                                                           ys
                  ’d
               “I
                                   The Blame Game

                   “I                                                        :
                        do Sy
                          n’t sa                                         e rt in”
                                                                       xp adm
                         De kno dmi                                 e
                                                                      E s
                           ve w! n                                ar e Sy
                             lop A
                                er sk                        d lew th
                                  ”   th                  id sk
                                        e               M a
                                                              s
                                                           et
                                                        “L
                                                                                         14
Thursday, September 23, 2010
Static instrumentation is time consuming

                                     Restart
             Stop App                                          Add Code            Compile
                                     w/ flags



             Prebuilt Instruments                              Custom Instruments



                               Instrument       Validate

                                                                        Run in
                                                                      production

                               Process          Collect info




                                                                                             15
Thursday, September 23, 2010
Debugging Transient Problems
         In production. Impossible!

            Please let me
            observe a live
            system.




                                        16
Thursday, September 23, 2010
If Only We Can ...


         • turn instrumentation ON and OFF
           dynamically
         • probe any arbitrary location
             • not just pre-defined probe points
         • collect arbitrary data
         • have low probing overhead
         • have no overhead for disabled probes




                                                   17
Thursday, September 23, 2010
Dynamic Tracing

        -> foo()               Application Logic
            -> bar()
            <- bar()
        <- foo()           Frameworks                       c
                        Presentation                       c+
                                                           ph
               12::SELECT id, name, symbol, conversion_rate FROM currencies WHERE
                    JSP/Javascript/Ajax




                                                                      pytho
               status = 'Active' and deleted = 0




                                                                              rub
                     Container
               12::SELECT category, name, value FROM config
                                      Glassfish/
                                                          perl
               12::SELECT id FROM outbound_email WHERE type = 'system'




                          Database                        shel
                                                               Native
                       Operating System Solaris/Linux/OS X/


                                                                                    18
Thursday, September 23, 2010
D - Scripts
      probe
         provider      : module :    probe   :   name       where

        /                      predicate                /    when
        {

                                actions                     do what

        }

                                                                    19
Thursday, September 23, 2010
DTrace examples

         nthreads
         {                                                                Thread
                printf("new thread created by %s(%d)n", execname,pid);   monitor
         }



     pid$1::malloc:entry                   pid$1:::entry
     {                                     {
              @=quantize(arg0);                  @[probefunc]=count();
     }                                     }

              malloc size                          hot method
               observer                              finder


                                                                               20
Thursday, September 23, 2010
More DTrace examples
                                 profile-101
                                 /execname==”java”/
                                 {
                                       @[tid]=count();
                                 }

                           How many Java threads are active?


      pid$1::sleep:entry                       io:::done
      {                                        {
               @[ustack()]=count();                  @=quantize(args[0]->b_bcount);
      }                                        }

          Who went to sleep?                          Size distribution of IO

                                                                                      21
Thursday, September 23, 2010
DTrace and Java

       • DTrace can observe the following in Java
            •   When VM starts and ends
            •   When thread starts and ends
            •   When class gets loaded and unloaded
            •   When object allocated and freed
            •   When GC starts and ends
            •   JNI calls
            •   When a method is called and method returns




                                                             22
Thursday, September 23, 2010
DTrace and Java - Example

         hotspot$1:::class-loaded
         {
                                                                 Class Loading
                printf("%s loadedn", copyinstr(arg0,arg1));
         }




  hotspot$1:::method-entry
  {
             @[copyinstr(arg1,arg2), copyinstr(arg3,arg4)]=count();   Java Methods
  }


  JVM needs to be started with -XX:+ExtendedDTraceProbes



                                                                                 23
Thursday, September 23, 2010
DTrace and Java - More Example
       #!/usr/sbin/dtrace -qs
       hotspot$1:::gc-begin
       {
            printf("GC started at %Yn",walltimestamp);
            printf("%20s | %-10sn", "pool", "time(ms)");
            printf(" ------------------------------------n");
            self->ts = timestamp;
       }

       hotspot$1:::mem-pool-gc-begin
                                                                                                 GC
       {
           self->pool_ts[copyinstr(arg2,arg3)] = timestamp;
       }
       hotspot$1:::mem-pool-gc-end
       {
           self->pool = copyinstr(arg2,arg3);
           printf("%20s | %-10dn", self->pool, (timestamp - self->pool_ts[self->pool])/1000);
       }
       hotspot$1:::gc-end
       /self->ts/
       {
             printf(" ------------------------------------n");
             printf("%20s | %-10dnn","Total GC time", (timestamp - self->ts)/1000);
       }




                                                                                                      24
Thursday, September 23, 2010
DTrace providers
                                                 Other
                                               Providers

                                                 DTrace
                                ip            core provider         cpc
                               tcp
                                                              mib     FC
                               udp     proc     DTrace
                                                 core         PID     sh
                                        fbt
        java                   iSCSI   IO             vminfo nfsv4
      perl                             syscall sysinfo
          ruby                   USDT
           python                            profile        nfsv3
       javascript                  plockstat                       mysql
                                                     lockstat         postgres
                                           kerberos



                                                                                 25
Thursday, September 23, 2010
DTrace Eco-Systems


          • DTraceToolkit
              • Collection of useful D-scripts


          • Chime
              • DTrace Data Visualization


          • D-Light
              • Sun Studio based tool to observe application using DTrace

          • DTrace analytics
              • DTrace based front end for Sun ZFS storage



                                                                            26
Thursday, September 23, 2010
DTrace & Oracle WebLogic Server




                                                           27

Thursday, September 23, 2010
Instrumenting JVM vs Byte Code
                   Byte Code




       gc-begin                class-loaded                method-entry
                                          method-compile-begin
       gc-end                  class-unloaded              method-return
                                          method-compile-end



                  Garbage           Class           JIT      Execution
                  Collector        Loader         Compiler    Engine
                                            JVM




                                                                           28
Thursday, September 23, 2010
Instrumenting JVM vs Byte Code
                   Byte Code                    @OnMethod
                                                {
                                                  clazz=”myclass”,
                                                  method=”mymeth”
                                                }




                  Garbage       Class           JIT      Execution
                  Collector    Loader         Compiler    Engine
                                        JVM

              BTrace Supports other annotations
                 @OnTimer, @OnError, @OnEvent & @OnLowMemory


                                                                     29
Thursday, September 23, 2010
BTrace Code Structure

       import com.sun.btrace.annotations.*;
       import statuc com.sun.btrace.BTraceUtil.*;
       @BTrace
       public class BTraceSample {
                                 clazz = “java.lang.thread”,
           @OnMethod (                method = “start”         )    where
       public static void func()

       {
                                 action                            do what

       }
                                                                         30
Thursday, September 23, 2010
Sample B-script

      import com.sun.btrace.annotations.*;
      import static com.sun.btrace.BTraceUtils.*;

      @BTrace public class ThreadStart {
        @OnMethod(                                            New
          clazz="java.lang.Thread",                        Java Thread
          method="start"                                     Tracer
        )
        public static void onnewThread(@Self Thread t) {
          println(strcat("starting ", name(t)));
        }
      }



                                                                         31
Thursday, September 23, 2010
More B-scripts
    @BTrace public class AllMethods {
     private static Aggregation count = newAggregation(AggregationFunction.COUNT);

        @OnMethod(
          clazz="/javax.swing..*/",
          method="/.*/"
        )
        public static void m(@ProbeClassName String probeClass,
                                      @ProbeMethodName String probeMethod) {
          AggregationKey key = newAggregationKey(strcat(probeClass,strcat(".",probeMethod)));
          addToAggregation(count,key,1);
        }

        @OnEvent public static void onEvent() {
             truncateAggregation(count,10);
             printAggregation("Count", count);
         }
    }

                               Count all javax.swing methods

                                                                                                32
Thursday, September 23, 2010
DTrace Vs BTrace
                      DTrace for JVM                   BTrace

                Dynamic tracing entire
                                             Only within a Java Process
                      system

                      Instrument JVM         Instrument Java Byte Code


                               D-script     Java like instrumentation Lang


               Link Java to entire stack           Just within Java

               High overhead for method      Low overhead for method
                        tracing                      tracing


                                                                             33
Thursday, September 23, 2010
Combining DTrace & BTrace




                                  Best




                                  DFrame
                                   of
                        DTrace   Both      BTrace
                                 Worlds




                                                    34
Thursday, September 23, 2010
Dynamic Tracing Framework for
          Oracle WebLogic Server




                                          35
Thursday, September 23, 2010
The DFrame config file
       • The Framework is controlled using the config file
       • Two types of probes
           • mapped
              • config file format
                    class:method:entry/exit:logical name
              • probe format
                    weblogic*:::event(logical name, class.method)
           • unmapped
              • config file format
                    class:method
              • probe format
                    weblogic*:::method-entry(class, method)
                    weblogic*:::method-return(class,method)



                                                                    36
Thursday, September 23, 2010
How to use the Framework
       • Only one command to remember
         embedProbes
       • Usage
         embedProbes <pid>
         embedProbes -f configFile <pid>
         embedProbes -d [debug on]
         embedProbes -B [save B-script]
       • The command reads config file, creates the b-script
         and embedded dprobes into weblogic




                                                               37
Thursday, September 23, 2010
Demonstration




                                    38

Thursday, September 23, 2010
Reducing the Observer Effect



      •   Use low overhead tools
          ✓ dframe overhead for most probes very low (<3%)
      •   Ability to dynamically enable and disable probes
          ✓ dframe can be turned on and off dynamically
      •   Measure the probe effect before running in production
          ✓ ex: for medrec application on a Sun T5140
            for processing 2016 transactions,
            this is 487,240 events
            the overhead us just %3.8




                                                                  39

Thursday, September 23, 2010
Learn more




          • White paper on DFrame
              – http://bit.ly/DFrame


          • Need pre-release access?
              – email dframe-interest_us@oracle.com




                                                      40

Thursday, September 23, 2010
DTrace Resources

   • DTrace Community Page
     • http://hub.opensolaris.org/bin/view/Community+Group+dtrace/

   • DTrace Documentation
     • http://wikis.sun.com/display/DTrace/Documentation

   • DTraceToolkit
     • http://hub.opensolaris.org/bin/view/Community+Group+dtrace/dtracetoolkit

   • DTrace Chime
     • http://hub.opensolaris.org/bin/view/Project+dtrace-chime/

   • DTrace Hands on Lab
     • http://dtracehol.com/ - AMI ami-22fd164b (dtrace-hol)


                                                                            41

Thursday, September 23, 2010
42

Thursday, September 23, 2010

Weitere ähnliche Inhalte

Was ist angesagt?

Memcachedb: The Complete Guide
Memcachedb: The Complete GuideMemcachedb: The Complete Guide
Memcachedb: The Complete Guideelliando dias
 
Make container without_docker_7
Make container without_docker_7Make container without_docker_7
Make container without_docker_7Sam Kim
 
Trying and evaluating the new features of GlusterFS 3.5
Trying and evaluating the new features of GlusterFS 3.5Trying and evaluating the new features of GlusterFS 3.5
Trying and evaluating the new features of GlusterFS 3.5Keisuke Takahashi
 
Linux MMAP & Ioremap introduction
Linux MMAP & Ioremap introductionLinux MMAP & Ioremap introduction
Linux MMAP & Ioremap introductionGene Chang
 
Distributed systems at ok.ru #rigadevday
Distributed systems at ok.ru #rigadevdayDistributed systems at ok.ru #rigadevday
Distributed systems at ok.ru #rigadevdayodnoklassniki.ru
 
6 examples to backup linux using dd command (including disk to disk)
6 examples to backup linux using dd command (including disk to disk)6 examples to backup linux using dd command (including disk to disk)
6 examples to backup linux using dd command (including disk to disk)chinkshady
 
Tracing Parallel Execution (UKOUG 2006)
Tracing Parallel Execution (UKOUG 2006)Tracing Parallel Execution (UKOUG 2006)
Tracing Parallel Execution (UKOUG 2006)Doug Burns
 
Webinar slides: The Holy Grail Webinar: Become a MySQL DBA - Database Perform...
Webinar slides: The Holy Grail Webinar: Become a MySQL DBA - Database Perform...Webinar slides: The Holy Grail Webinar: Become a MySQL DBA - Database Perform...
Webinar slides: The Holy Grail Webinar: Become a MySQL DBA - Database Perform...Severalnines
 
Two single node cluster to one multinode cluster
Two single node cluster to one multinode clusterTwo single node cluster to one multinode cluster
Two single node cluster to one multinode clustersushantbit04
 
Make container without_docker_6-overlay-network_1
Make container without_docker_6-overlay-network_1 Make container without_docker_6-overlay-network_1
Make container without_docker_6-overlay-network_1 Sam Kim
 
Linux performance tuning & stabilization tips (mysqlconf2010)
Linux performance tuning & stabilization tips (mysqlconf2010)Linux performance tuning & stabilization tips (mysqlconf2010)
Linux performance tuning & stabilization tips (mysqlconf2010)Yoshinori Matsunobu
 
The 7 Deadly Sins of Packet Processing - Venky Venkatesan and Bruce Richardson
The 7 Deadly Sins of Packet Processing - Venky Venkatesan and Bruce RichardsonThe 7 Deadly Sins of Packet Processing - Venky Venkatesan and Bruce Richardson
The 7 Deadly Sins of Packet Processing - Venky Venkatesan and Bruce Richardsonharryvanhaaren
 
Apache con 2012 taking the guesswork out of your hadoop infrastructure
Apache con 2012 taking the guesswork out of your hadoop infrastructureApache con 2012 taking the guesswork out of your hadoop infrastructure
Apache con 2012 taking the guesswork out of your hadoop infrastructureSteve Watt
 
Building Apache Cassandra clusters for massive scale
Building Apache Cassandra clusters for massive scaleBuilding Apache Cassandra clusters for massive scale
Building Apache Cassandra clusters for massive scaleAlex Thompson
 
Linux con europe_2014_f
Linux con europe_2014_fLinux con europe_2014_f
Linux con europe_2014_fsprdd
 

Was ist angesagt? (19)

Hadoop 3.1.1 single node
Hadoop 3.1.1 single nodeHadoop 3.1.1 single node
Hadoop 3.1.1 single node
 
Memcachedb: The Complete Guide
Memcachedb: The Complete GuideMemcachedb: The Complete Guide
Memcachedb: The Complete Guide
 
Postgres Toolkit
Postgres ToolkitPostgres Toolkit
Postgres Toolkit
 
Make container without_docker_7
Make container without_docker_7Make container without_docker_7
Make container without_docker_7
 
Trying and evaluating the new features of GlusterFS 3.5
Trying and evaluating the new features of GlusterFS 3.5Trying and evaluating the new features of GlusterFS 3.5
Trying and evaluating the new features of GlusterFS 3.5
 
Linux MMAP & Ioremap introduction
Linux MMAP & Ioremap introductionLinux MMAP & Ioremap introduction
Linux MMAP & Ioremap introduction
 
Putting some "logic" in LVM.
Putting some "logic" in LVM.Putting some "logic" in LVM.
Putting some "logic" in LVM.
 
Distributed systems at ok.ru #rigadevday
Distributed systems at ok.ru #rigadevdayDistributed systems at ok.ru #rigadevday
Distributed systems at ok.ru #rigadevday
 
6 examples to backup linux using dd command (including disk to disk)
6 examples to backup linux using dd command (including disk to disk)6 examples to backup linux using dd command (including disk to disk)
6 examples to backup linux using dd command (including disk to disk)
 
Tracing Parallel Execution (UKOUG 2006)
Tracing Parallel Execution (UKOUG 2006)Tracing Parallel Execution (UKOUG 2006)
Tracing Parallel Execution (UKOUG 2006)
 
Webinar slides: The Holy Grail Webinar: Become a MySQL DBA - Database Perform...
Webinar slides: The Holy Grail Webinar: Become a MySQL DBA - Database Perform...Webinar slides: The Holy Grail Webinar: Become a MySQL DBA - Database Perform...
Webinar slides: The Holy Grail Webinar: Become a MySQL DBA - Database Perform...
 
Tips of Malloc & Free
Tips of Malloc & FreeTips of Malloc & Free
Tips of Malloc & Free
 
Two single node cluster to one multinode cluster
Two single node cluster to one multinode clusterTwo single node cluster to one multinode cluster
Two single node cluster to one multinode cluster
 
Make container without_docker_6-overlay-network_1
Make container without_docker_6-overlay-network_1 Make container without_docker_6-overlay-network_1
Make container without_docker_6-overlay-network_1
 
Linux performance tuning & stabilization tips (mysqlconf2010)
Linux performance tuning & stabilization tips (mysqlconf2010)Linux performance tuning & stabilization tips (mysqlconf2010)
Linux performance tuning & stabilization tips (mysqlconf2010)
 
The 7 Deadly Sins of Packet Processing - Venky Venkatesan and Bruce Richardson
The 7 Deadly Sins of Packet Processing - Venky Venkatesan and Bruce RichardsonThe 7 Deadly Sins of Packet Processing - Venky Venkatesan and Bruce Richardson
The 7 Deadly Sins of Packet Processing - Venky Venkatesan and Bruce Richardson
 
Apache con 2012 taking the guesswork out of your hadoop infrastructure
Apache con 2012 taking the guesswork out of your hadoop infrastructureApache con 2012 taking the guesswork out of your hadoop infrastructure
Apache con 2012 taking the guesswork out of your hadoop infrastructure
 
Building Apache Cassandra clusters for massive scale
Building Apache Cassandra clusters for massive scaleBuilding Apache Cassandra clusters for massive scale
Building Apache Cassandra clusters for massive scale
 
Linux con europe_2014_f
Linux con europe_2014_fLinux con europe_2014_f
Linux con europe_2014_f
 

Andere mochten auch

DTrace - Miracle Scotland Database Forum
DTrace - Miracle Scotland Database ForumDTrace - Miracle Scotland Database Forum
DTrace - Miracle Scotland Database ForumDoug Burns
 
A brief history of DTrace
A brief history of DTraceA brief history of DTrace
A brief history of DTraceahl0003
 
Solaris Kernel Debugging V1.0
Solaris Kernel Debugging V1.0Solaris Kernel Debugging V1.0
Solaris Kernel Debugging V1.0Jarod Wang
 
Os Leventhal
Os LeventhalOs Leventhal
Os Leventhaloscon2007
 
Cloud Observation and Performance Analysis using Solaris 11 DTrace
Cloud Observation and Performance Analysis using Solaris 11 DTraceCloud Observation and Performance Analysis using Solaris 11 DTrace
Cloud Observation and Performance Analysis using Solaris 11 DTraceOrgad Kimchi
 
Oraclew2013 devopsjlm
Oraclew2013 devopsjlmOraclew2013 devopsjlm
Oraclew2013 devopsjlmNadav Lankin
 
Solaris Internals Preso circa 2009
Solaris Internals Preso circa 2009Solaris Internals Preso circa 2009
Solaris Internals Preso circa 2009Richard McDougall
 
#lspe Building a Monitoring Framework using DTrace and MongoDB
#lspe Building a Monitoring Framework using DTrace and MongoDB#lspe Building a Monitoring Framework using DTrace and MongoDB
#lspe Building a Monitoring Framework using DTrace and MongoDBdan-p-kimmel
 
Christo kutrovsky oracle rac solving common scalability problems
Christo kutrovsky   oracle rac solving common scalability problemsChristo kutrovsky   oracle rac solving common scalability problems
Christo kutrovsky oracle rac solving common scalability problemsChristo Kutrovsky
 
Facebook Powerpoint
Facebook PowerpointFacebook Powerpoint
Facebook Powerpointmyra14
 

Andere mochten auch (12)

DTrace - Miracle Scotland Database Forum
DTrace - Miracle Scotland Database ForumDTrace - Miracle Scotland Database Forum
DTrace - Miracle Scotland Database Forum
 
A brief history of DTrace
A brief history of DTraceA brief history of DTrace
A brief history of DTrace
 
Solaris Kernel Debugging V1.0
Solaris Kernel Debugging V1.0Solaris Kernel Debugging V1.0
Solaris Kernel Debugging V1.0
 
Os Leventhal
Os LeventhalOs Leventhal
Os Leventhal
 
DTrace
DTraceDTrace
DTrace
 
OpenSolaris 2009.06 Workshop
OpenSolaris 2009.06 WorkshopOpenSolaris 2009.06 Workshop
OpenSolaris 2009.06 Workshop
 
Cloud Observation and Performance Analysis using Solaris 11 DTrace
Cloud Observation and Performance Analysis using Solaris 11 DTraceCloud Observation and Performance Analysis using Solaris 11 DTrace
Cloud Observation and Performance Analysis using Solaris 11 DTrace
 
Oraclew2013 devopsjlm
Oraclew2013 devopsjlmOraclew2013 devopsjlm
Oraclew2013 devopsjlm
 
Solaris Internals Preso circa 2009
Solaris Internals Preso circa 2009Solaris Internals Preso circa 2009
Solaris Internals Preso circa 2009
 
#lspe Building a Monitoring Framework using DTrace and MongoDB
#lspe Building a Monitoring Framework using DTrace and MongoDB#lspe Building a Monitoring Framework using DTrace and MongoDB
#lspe Building a Monitoring Framework using DTrace and MongoDB
 
Christo kutrovsky oracle rac solving common scalability problems
Christo kutrovsky   oracle rac solving common scalability problemsChristo kutrovsky   oracle rac solving common scalability problems
Christo kutrovsky oracle rac solving common scalability problems
 
Facebook Powerpoint
Facebook PowerpointFacebook Powerpoint
Facebook Powerpoint
 

Ähnlich wie DTrace talk at Oracle Open World

Beat the devil: towards a Drupal performance benchmark
Beat the devil: towards a Drupal performance benchmarkBeat the devil: towards a Drupal performance benchmark
Beat the devil: towards a Drupal performance benchmarkPedro González Serrano
 
Common Sense Performance Indicators in the Cloud
Common Sense Performance Indicators in the CloudCommon Sense Performance Indicators in the Cloud
Common Sense Performance Indicators in the CloudNick Gerner
 
Monitoring&Logging - Stanislav Kolenkin
Monitoring&Logging - Stanislav Kolenkin  Monitoring&Logging - Stanislav Kolenkin
Monitoring&Logging - Stanislav Kolenkin Kuberton
 
Planning For High Performance Web Application
Planning For High Performance Web ApplicationPlanning For High Performance Web Application
Planning For High Performance Web ApplicationYue Tian
 
State of Puppet - Puppet Camp Silicon Valley 2014
State of Puppet - Puppet Camp Silicon Valley 2014State of Puppet - Puppet Camp Silicon Valley 2014
State of Puppet - Puppet Camp Silicon Valley 2014Puppet
 
breed_python_tx_redacted
breed_python_tx_redactedbreed_python_tx_redacted
breed_python_tx_redactedRyan Breed
 
Puppet Camp Boston 2014: Keynote
Puppet Camp Boston 2014: Keynote Puppet Camp Boston 2014: Keynote
Puppet Camp Boston 2014: Keynote Puppet
 
Observability in real time at scale
Observability in real time at scaleObservability in real time at scale
Observability in real time at scaleBalvinder Hira
 
The sFlow Standard: Scalable, Unified Monitoring of Networks, Systems and App...
The sFlow Standard: Scalable, Unified Monitoring of Networks, Systems and App...The sFlow Standard: Scalable, Unified Monitoring of Networks, Systems and App...
The sFlow Standard: Scalable, Unified Monitoring of Networks, Systems and App...netvis
 
Running High-Speed Serverless with nuclio
Running High-Speed Serverless with nuclioRunning High-Speed Serverless with nuclio
Running High-Speed Serverless with nuclioiguazio
 
Breaking The Clustering Limits @ AlphaCSP JavaEdge 2007
Breaking The Clustering Limits @ AlphaCSP JavaEdge 2007Breaking The Clustering Limits @ AlphaCSP JavaEdge 2007
Breaking The Clustering Limits @ AlphaCSP JavaEdge 2007Baruch Sadogursky
 
Productionizing Machine Learning - Bigdata meetup 5-06-2019
Productionizing Machine Learning - Bigdata meetup 5-06-2019Productionizing Machine Learning - Bigdata meetup 5-06-2019
Productionizing Machine Learning - Bigdata meetup 5-06-2019Iulian Pintoiu
 
Alex Wade, Digital Library Interoperability
Alex Wade, Digital Library InteroperabilityAlex Wade, Digital Library Interoperability
Alex Wade, Digital Library Interoperabilityparker01
 
Distributed computing and hyper-parameter tuning with Ray
Distributed computing and hyper-parameter tuning with RayDistributed computing and hyper-parameter tuning with Ray
Distributed computing and hyper-parameter tuning with RayJan Margeta
 
Testbed for Heterogeneous Cloud
Testbed for Heterogeneous CloudTestbed for Heterogeneous Cloud
Testbed for Heterogeneous CloudCloudLightning
 
Heroku @ Toyota Motor Europe: Platform As A Factory As A Service
Heroku @ Toyota Motor Europe: Platform As A Factory As A ServiceHeroku @ Toyota Motor Europe: Platform As A Factory As A Service
Heroku @ Toyota Motor Europe: Platform As A Factory As A ServiceCQD
 
Automating Oracle Database deployment with Amazon Web Services, fabric, and boto
Automating Oracle Database deployment with Amazon Web Services, fabric, and botoAutomating Oracle Database deployment with Amazon Web Services, fabric, and boto
Automating Oracle Database deployment with Amazon Web Services, fabric, and botomjbommar
 
Analyzing .Net Application Memory Usage And Issues
Analyzing .Net Application Memory Usage And IssuesAnalyzing .Net Application Memory Usage And Issues
Analyzing .Net Application Memory Usage And IssuesGreg Sohl
 
What’s Mule 4.3? How Does Anytime RTF Help? Our insights explain.
What’s Mule 4.3? How Does Anytime RTF Help? Our insights explain. What’s Mule 4.3? How Does Anytime RTF Help? Our insights explain.
What’s Mule 4.3? How Does Anytime RTF Help? Our insights explain. Kellton Tech Solutions Ltd
 

Ähnlich wie DTrace talk at Oracle Open World (20)

Beat the devil: towards a Drupal performance benchmark
Beat the devil: towards a Drupal performance benchmarkBeat the devil: towards a Drupal performance benchmark
Beat the devil: towards a Drupal performance benchmark
 
Common Sense Performance Indicators in the Cloud
Common Sense Performance Indicators in the CloudCommon Sense Performance Indicators in the Cloud
Common Sense Performance Indicators in the Cloud
 
Monitoring&Logging - Stanislav Kolenkin
Monitoring&Logging - Stanislav Kolenkin  Monitoring&Logging - Stanislav Kolenkin
Monitoring&Logging - Stanislav Kolenkin
 
Planning For High Performance Web Application
Planning For High Performance Web ApplicationPlanning For High Performance Web Application
Planning For High Performance Web Application
 
State of Puppet - Puppet Camp Silicon Valley 2014
State of Puppet - Puppet Camp Silicon Valley 2014State of Puppet - Puppet Camp Silicon Valley 2014
State of Puppet - Puppet Camp Silicon Valley 2014
 
breed_python_tx_redacted
breed_python_tx_redactedbreed_python_tx_redacted
breed_python_tx_redacted
 
Puppet Camp Boston 2014: Keynote
Puppet Camp Boston 2014: Keynote Puppet Camp Boston 2014: Keynote
Puppet Camp Boston 2014: Keynote
 
Observability in real time at scale
Observability in real time at scaleObservability in real time at scale
Observability in real time at scale
 
The sFlow Standard: Scalable, Unified Monitoring of Networks, Systems and App...
The sFlow Standard: Scalable, Unified Monitoring of Networks, Systems and App...The sFlow Standard: Scalable, Unified Monitoring of Networks, Systems and App...
The sFlow Standard: Scalable, Unified Monitoring of Networks, Systems and App...
 
Running High-Speed Serverless with nuclio
Running High-Speed Serverless with nuclioRunning High-Speed Serverless with nuclio
Running High-Speed Serverless with nuclio
 
Breaking The Clustering Limits @ AlphaCSP JavaEdge 2007
Breaking The Clustering Limits @ AlphaCSP JavaEdge 2007Breaking The Clustering Limits @ AlphaCSP JavaEdge 2007
Breaking The Clustering Limits @ AlphaCSP JavaEdge 2007
 
Productionizing Machine Learning - Bigdata meetup 5-06-2019
Productionizing Machine Learning - Bigdata meetup 5-06-2019Productionizing Machine Learning - Bigdata meetup 5-06-2019
Productionizing Machine Learning - Bigdata meetup 5-06-2019
 
Alex Wade, Digital Library Interoperability
Alex Wade, Digital Library InteroperabilityAlex Wade, Digital Library Interoperability
Alex Wade, Digital Library Interoperability
 
Distributed computing and hyper-parameter tuning with Ray
Distributed computing and hyper-parameter tuning with RayDistributed computing and hyper-parameter tuning with Ray
Distributed computing and hyper-parameter tuning with Ray
 
Testbed for Heterogeneous Cloud
Testbed for Heterogeneous CloudTestbed for Heterogeneous Cloud
Testbed for Heterogeneous Cloud
 
Heroku @ Toyota Motor Europe: Platform As A Factory As A Service
Heroku @ Toyota Motor Europe: Platform As A Factory As A ServiceHeroku @ Toyota Motor Europe: Platform As A Factory As A Service
Heroku @ Toyota Motor Europe: Platform As A Factory As A Service
 
Automating Oracle Database deployment with Amazon Web Services, fabric, and boto
Automating Oracle Database deployment with Amazon Web Services, fabric, and botoAutomating Oracle Database deployment with Amazon Web Services, fabric, and boto
Automating Oracle Database deployment with Amazon Web Services, fabric, and boto
 
Performance on a budget
Performance on a budgetPerformance on a budget
Performance on a budget
 
Analyzing .Net Application Memory Usage And Issues
Analyzing .Net Application Memory Usage And IssuesAnalyzing .Net Application Memory Usage And Issues
Analyzing .Net Application Memory Usage And Issues
 
What’s Mule 4.3? How Does Anytime RTF Help? Our insights explain.
What’s Mule 4.3? How Does Anytime RTF Help? Our insights explain. What’s Mule 4.3? How Does Anytime RTF Help? Our insights explain.
What’s Mule 4.3? How Does Anytime RTF Help? Our insights explain.
 

DTrace talk at Oracle Open World

  • 2. <Insert Picture Here> Oracle Performance Measurement and Tuning with Solaris DTrace Jeff Savit Principal Sales Consultant Angelo Rajadurai Principal Software Engineer Thursday, September 23, 2010
  • 3. The following is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, and timing of any features or functionality described for Oracle’s products remains at the sole discretion of Oracle. 3 Thursday, September 23, 2010
  • 4. Agenda • Basic Concepts of Performance Tuning <Insert Picture Here> • Performance Tuning Features in Solaris • DTrace - Dynamically Observing the Entire Application Stack • Dynamic Tracing Oracle WebLogic Server with DTrace • Further Reading 4 Thursday, September 23, 2010
  • 5. Basic Concepts for Performance Management Measure Performance Analyze Define Performance Model & Goals Model Deduce Take Action 5 Thursday, September 23, 2010
  • 6. Start with the Best Platform Solaris - Designed for Performance & Scale Dynamic, multithreaded, preemptive kernel and process model Tightly integrated file system and virtual memory 64-bit kernel, supporting both 32-bit and 64-bit applications Resource management Optimized, SMP-hot network stack CPU and memory scalability from low to high. Today, up to: 256 CPUs on T5440, 512 on M9000; 4TB RAM on M9000 Optimized for modern multicore, multithread, NUMA systems Premier x86 support optimized for Intel Nehalem and AMD Opteron Solaris Containers (Zones): negligible-overhead, built in virtualization 6 Thursday, September 23, 2010
  • 7. Define the Problem • High system time is not a problem • You may be asking the system to do stuff • Slow I/O is not a problem • You may be streaming bulk I/O • 100% utilization is not a problem • You are using all the box you paid for :-) • Modern CPUs, NICs, disks, can do more than 1 thing at a time without adding delay • Fine even if saturated unless some work unable to get enough cycles to meet SLA • None of these are problems unless they relate to business metrics 7 Thursday, September 23, 2010
  • 8. Monitor: Right Location & Tools ruby Frameworks python Presentation php C++ C JSP/Javascript/Ajax/JavaFX perl Container WebLogic Server shell Database Apps run Native in VM Apps Oracle 11g Operating System Solaris/OEL/Windows 8 Thursday, September 23, 2010
  • 9. Solaris Tool chest Tracing & Debugging Proc tools abitrace - trace ABI interfaces cputrack - per-processor hw counters mdb – debug process/kernel pargs – process arguments truss – trace function and system calls pflags – process flags pcred – process credentials pldd – process's library dependencies System Statistics plockstat – process lock statistics psig – process signal disposition acctcom – process accounting pstack – process stack dump busstat – Bus hardware counters pmap – process memory map cpustat – CPU hardware counters iostat – IO & NFS statistics pfiles – open files and names kstat – display kernel statistics prstat – process statistics mpstat – processor statistics ptree – process tree netstat – network statistics ptime – process microstate times nfsstat – nfs server stats pwdx – process working directory sar – kitchen sink utility pgrep – grep for processes vmstat – virtual memory stats pkill – kill processes list pstop – stop processes prun – start processes Toolkits prctl – view/set process resources pwait – wait for process DTraceToolkit – DTrace Tools preap – reap a zombie process K9Toolkit – perl perf tools nicstat – network stats 9 Thursday, September 23, 2010
  • 10. perfbar see the big picture from across the room Don't be shy about starting with a simple graphical tool! http://blogs.sun.com/partnertech/ resource/tools/perfbar.{sparc,i386} See:LDOM Booth for use of perfbar 10 Thursday, September 23, 2010
  • 11. Fenxi Reading a 1000 lines of text does not show you the big picture Open source tool written at Sun for aggregating and displaying vmstat, mpstat, iostat data https://fenxi.dev.java.net/ 11 Thursday, September 23, 2010
  • 12. So why do we need another tool? 12 Thursday, September 23, 2010
  • 13. Observing the Stack is hard ruby Frameworks python Presentation php C++ C JSP/Javascript/Ajax/JavaFX perl Container WebLogic Server shell Database Apps run Native in VM Apps Oracle 11g Operating System Solaris/OEL/Windows 13 Thursday, September 23, 2010
  • 14. “M ay m in” D be ata : ad th bas er se e e e lop aba w i m Ad ev dat ll idd mi D kn le n: o w wa t he ” re k gu as ys ’d “I The Blame Game “I : do Sy n’t sa e rt in” xp adm De kno dmi e E s ve w! n ar e Sy lop A er sk d lew th ” th id sk e M a s et “L 14 Thursday, September 23, 2010
  • 15. Static instrumentation is time consuming Restart Stop App Add Code Compile w/ flags Prebuilt Instruments Custom Instruments Instrument Validate Run in production Process Collect info 15 Thursday, September 23, 2010
  • 16. Debugging Transient Problems In production. Impossible! Please let me observe a live system. 16 Thursday, September 23, 2010
  • 17. If Only We Can ... • turn instrumentation ON and OFF dynamically • probe any arbitrary location • not just pre-defined probe points • collect arbitrary data • have low probing overhead • have no overhead for disabled probes 17 Thursday, September 23, 2010
  • 18. Dynamic Tracing -> foo() Application Logic -> bar() <- bar() <- foo() Frameworks c Presentation c+ ph 12::SELECT id, name, symbol, conversion_rate FROM currencies WHERE JSP/Javascript/Ajax pytho status = 'Active' and deleted = 0 rub Container 12::SELECT category, name, value FROM config Glassfish/ perl 12::SELECT id FROM outbound_email WHERE type = 'system' Database shel Native Operating System Solaris/Linux/OS X/ 18 Thursday, September 23, 2010
  • 19. D - Scripts probe provider : module : probe : name where / predicate / when { actions do what } 19 Thursday, September 23, 2010
  • 20. DTrace examples nthreads { Thread printf("new thread created by %s(%d)n", execname,pid); monitor } pid$1::malloc:entry pid$1:::entry { { @=quantize(arg0); @[probefunc]=count(); } } malloc size hot method observer finder 20 Thursday, September 23, 2010
  • 21. More DTrace examples profile-101 /execname==”java”/ { @[tid]=count(); } How many Java threads are active? pid$1::sleep:entry io:::done { { @[ustack()]=count(); @=quantize(args[0]->b_bcount); } } Who went to sleep? Size distribution of IO 21 Thursday, September 23, 2010
  • 22. DTrace and Java • DTrace can observe the following in Java • When VM starts and ends • When thread starts and ends • When class gets loaded and unloaded • When object allocated and freed • When GC starts and ends • JNI calls • When a method is called and method returns 22 Thursday, September 23, 2010
  • 23. DTrace and Java - Example hotspot$1:::class-loaded { Class Loading printf("%s loadedn", copyinstr(arg0,arg1)); } hotspot$1:::method-entry { @[copyinstr(arg1,arg2), copyinstr(arg3,arg4)]=count(); Java Methods } JVM needs to be started with -XX:+ExtendedDTraceProbes 23 Thursday, September 23, 2010
  • 24. DTrace and Java - More Example #!/usr/sbin/dtrace -qs hotspot$1:::gc-begin { printf("GC started at %Yn",walltimestamp); printf("%20s | %-10sn", "pool", "time(ms)"); printf(" ------------------------------------n"); self->ts = timestamp; } hotspot$1:::mem-pool-gc-begin GC { self->pool_ts[copyinstr(arg2,arg3)] = timestamp; } hotspot$1:::mem-pool-gc-end { self->pool = copyinstr(arg2,arg3); printf("%20s | %-10dn", self->pool, (timestamp - self->pool_ts[self->pool])/1000); } hotspot$1:::gc-end /self->ts/ { printf(" ------------------------------------n"); printf("%20s | %-10dnn","Total GC time", (timestamp - self->ts)/1000); } 24 Thursday, September 23, 2010
  • 25. DTrace providers Other Providers DTrace ip core provider cpc tcp mib FC udp proc DTrace core PID sh fbt java iSCSI IO vminfo nfsv4 perl syscall sysinfo ruby USDT python profile nfsv3 javascript plockstat mysql lockstat postgres kerberos 25 Thursday, September 23, 2010
  • 26. DTrace Eco-Systems • DTraceToolkit • Collection of useful D-scripts • Chime • DTrace Data Visualization • D-Light • Sun Studio based tool to observe application using DTrace • DTrace analytics • DTrace based front end for Sun ZFS storage 26 Thursday, September 23, 2010
  • 27. DTrace & Oracle WebLogic Server 27 Thursday, September 23, 2010
  • 28. Instrumenting JVM vs Byte Code Byte Code gc-begin class-loaded method-entry method-compile-begin gc-end class-unloaded method-return method-compile-end Garbage Class JIT Execution Collector Loader Compiler Engine JVM 28 Thursday, September 23, 2010
  • 29. Instrumenting JVM vs Byte Code Byte Code @OnMethod { clazz=”myclass”, method=”mymeth” } Garbage Class JIT Execution Collector Loader Compiler Engine JVM BTrace Supports other annotations @OnTimer, @OnError, @OnEvent & @OnLowMemory 29 Thursday, September 23, 2010
  • 30. BTrace Code Structure import com.sun.btrace.annotations.*; import statuc com.sun.btrace.BTraceUtil.*; @BTrace public class BTraceSample { clazz = “java.lang.thread”, @OnMethod ( method = “start” ) where public static void func() { action do what } 30 Thursday, September 23, 2010
  • 31. Sample B-script import com.sun.btrace.annotations.*; import static com.sun.btrace.BTraceUtils.*; @BTrace public class ThreadStart { @OnMethod( New clazz="java.lang.Thread", Java Thread method="start" Tracer ) public static void onnewThread(@Self Thread t) { println(strcat("starting ", name(t))); } } 31 Thursday, September 23, 2010
  • 32. More B-scripts @BTrace public class AllMethods { private static Aggregation count = newAggregation(AggregationFunction.COUNT); @OnMethod( clazz="/javax.swing..*/", method="/.*/" ) public static void m(@ProbeClassName String probeClass, @ProbeMethodName String probeMethod) { AggregationKey key = newAggregationKey(strcat(probeClass,strcat(".",probeMethod))); addToAggregation(count,key,1); } @OnEvent public static void onEvent() { truncateAggregation(count,10); printAggregation("Count", count); } } Count all javax.swing methods 32 Thursday, September 23, 2010
  • 33. DTrace Vs BTrace DTrace for JVM BTrace Dynamic tracing entire Only within a Java Process system Instrument JVM Instrument Java Byte Code D-script Java like instrumentation Lang Link Java to entire stack Just within Java High overhead for method Low overhead for method tracing tracing 33 Thursday, September 23, 2010
  • 34. Combining DTrace & BTrace Best DFrame of DTrace Both BTrace Worlds 34 Thursday, September 23, 2010
  • 35. Dynamic Tracing Framework for Oracle WebLogic Server 35 Thursday, September 23, 2010
  • 36. The DFrame config file • The Framework is controlled using the config file • Two types of probes • mapped • config file format class:method:entry/exit:logical name • probe format weblogic*:::event(logical name, class.method) • unmapped • config file format class:method • probe format weblogic*:::method-entry(class, method) weblogic*:::method-return(class,method) 36 Thursday, September 23, 2010
  • 37. How to use the Framework • Only one command to remember embedProbes • Usage embedProbes <pid> embedProbes -f configFile <pid> embedProbes -d [debug on] embedProbes -B [save B-script] • The command reads config file, creates the b-script and embedded dprobes into weblogic 37 Thursday, September 23, 2010
  • 38. Demonstration 38 Thursday, September 23, 2010
  • 39. Reducing the Observer Effect • Use low overhead tools ✓ dframe overhead for most probes very low (<3%) • Ability to dynamically enable and disable probes ✓ dframe can be turned on and off dynamically • Measure the probe effect before running in production ✓ ex: for medrec application on a Sun T5140 for processing 2016 transactions, this is 487,240 events the overhead us just %3.8 39 Thursday, September 23, 2010
  • 40. Learn more • White paper on DFrame – http://bit.ly/DFrame • Need pre-release access? – email dframe-interest_us@oracle.com 40 Thursday, September 23, 2010
  • 41. DTrace Resources • DTrace Community Page • http://hub.opensolaris.org/bin/view/Community+Group+dtrace/ • DTrace Documentation • http://wikis.sun.com/display/DTrace/Documentation • DTraceToolkit • http://hub.opensolaris.org/bin/view/Community+Group+dtrace/dtracetoolkit • DTrace Chime • http://hub.opensolaris.org/bin/view/Project+dtrace-chime/ • DTrace Hands on Lab • http://dtracehol.com/ - AMI ami-22fd164b (dtrace-hol) 41 Thursday, September 23, 2010