4 Replies Latest reply: Sep 30, 2011 10:48 AM by SSt RSS

    Cannot set DYE INJECTION 'simple' feature

      --- system information ---
      Windows server 2008 R2
      Weblogic 10.3.2
      Sun JVM 1.6.0_20

      Hi all,

      I have an EAR containing a war deployed on a cluster made of 2 managed servers.
      This web app is very slow and I try to figure out where the bottleneck could be.

      Therefore I try to enable the "Dye Injection" feature to get metrics; especially elapsed time in Weblogic.

      I follow the Weblogic doco to setup 'simple' dye-injection (no instrumentation at application-level) but it doesn't seem to work, I'm requesting your help because I don't get what I'm missing.

      Here's my diagnostic monitor configuration
      <?xml version='1.0' encoding='UTF-8'?>
      <wldf-resource xmlns="http://xmlns.oracle.com/weblogic/weblogic-diagnostics" xmlns:sec="http://xmlns.oracle.com/weblogic/security" xmlns:wls="http://xmlns.oracle.com/weblogic/security/wls" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.oracle.com/weblogic/weblogic-diagnostics http://xmlns.oracle.com/weblogic/weblogic-diagnostics/1.0/weblogic-diagnostics.xsd">
      <dye-mask xsi:nil="true"></dye-mask>

      When I restart me server I can see some 'ContextID' which make me think my confi is OK
      ####<Sep 27, 2011 5:23:11 PM CEST> <Info> <Health> <EQDG1UZSMRTD001> <SmartDispatcherNodeConsole1> <weblogic.GCMonitor> <<anonymous>> <> <92c80240c00d4dbc:-7cdcb7df:132ab66e5ec:-7ffd-000000000000002e> <1317136991923> <BEA-310002> <35% of the total memory in the server is free>

      But This message makes me think something is still not set correctly
      ####<Sep 27, 2011 5:02:14 PM CEST> <Info> <Diagnostics> <EQDG1UZSMRTD001> <SmartDispatcherNodeConsole1> <[STANDBY] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <92c80240c00d4dbc:-7cdcb7df:132ab66e5ec:-7ffd-0000000000000016> <1317135734942> <BEA-320129> <Instrumentation module bea_wls_diagnostics created.>
      ####<Sep 27, 2011 5:02:14 PM CEST> <Warning> <Diagnostics> <EQDG1UZSMRTD001> <SmartDispatcherNodeConsole1> <[STANDBY] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <92c80240c00d4dbc:-7cdcb7df:132ab66e5ec:-7ffd-0000000000000016> <1317135734943> <BEA-320130> <Instrumentation module bea_wls_diagnostics is disabled.>

      The result is when I'm connected to my website directly targeting one node, I don't see any message in my ADmin Console (under diagnostics-->Log files)

      I'd appreciate if anyone could help me on this.

      Thanks all.
        • 1. Re: Cannot set DYE INJECTION 'simple' feature
          René van Wijk
          The post here (http://middlewaremagic.com/weblogic/?p=6016) explains a step-by-step example.
          Look for the 'Instrumentation' section.
          • 2. Re: Cannot set DYE INJECTION 'simple' feature
            Thanks René,

            I've read your link (excellent link by the way) but now I have other questions.

            In your example, you create and diagnostic configuration file that must be packaged in the application. As I'm just a weblogic admin, I'm not 'supposed' to do such operation.
            Morevover your config file contains ref to EJB / MDB to monitor, as I don't know the application this task might be difficult for me.

            I though I could simply activate the 'dyeinjection' feature on server scope and I could get metrics like:
            spent x milliseconds in a servlet
            spent x milliseconds in EJNB
            spent x milliseconds in JDBC...

            I guess I didn't understand how this really work. If this is the case maybe I'll have to investigate how my application work.

            Thank you.
            • 3. Re: Cannot set DYE INJECTION 'simple' feature
              René van Wijk
              When you are interested in execution time it is handy to use a profiling tool to see which methods are consuming a lot of time.

              As you are using Sun JVM 1.6.0_20, you can use jvisualvm for this purpose (http://visualvm.java.net/profiler.html)
              What you can use for your purpose is the CPU profiling feature. jvisualvm is located in the ${JAVA_HOME}/bin directory

              You can use the sampler (CPU) environment the spot the hot spots (method) in the application.

              jvisualvm documentation can be found here: http://visualvm.java.net/docindex.html


              Note that DyeInjection configures WLDF to check for certain requests (such are they from a specific user or IP-address)
              A diagnostic context is attached to the request that remains with the request for the duration of the request lifecycle.
              DyeInjection can add flags to the diagnostic context such as USER1 or ADDR1. An application that has instrumentation enabled
              can use this to filter, such that a configured action is only performed when the flags are present.
              - http://download.oracle.com/docs/cd/E21764_01/web.1111/e13714/config_context.htm#i1110058

              The following link describes how to configure instrumentation on the application:
              - http://download.oracle.com/docs/cd/E21764_01/apirefs.1111/e13952/taskhelp/diagnostics/ConfigureInstrumentationForApplications.html
              For example, to get insight in the service time of the servlets in your application you can choose the service_around_service as monitor.
              Next you can configure which metrics you want to observe. When you click on the configured monitor you can choose for example
              the TraceElapsedTimeAction. This action can be configured to use Dye Filtering by selecting specific flags, such as USER1 or ADDR1.
              Say, for example, that we configured DyeInjection with the property: USER1=weblogic, the action will only be performed when
              the weblogic user originated the request.
              • 4. Re: Cannot set DYE INJECTION 'simple' feature
                This is what I did.

                I enabled the DyeInjection on my IP with the following configuration:
                <dye-mask xsi:nil="true"></dye-mask>

                This is an uat environment so I' m sure to be the unique user on it. Unfortunately I couldn't see the result of activating Dye injection.

                I'll have a look at your link in the next week but not the coming one as I'll work on something else.

                Thanks for all