d8888 888 888      88888888888 888      d8b                                 888       888          888       .d8888b.           888                               
      d88888 888 888          888     888      Y8P                                 888   o   888          888      d88P  Y88b          888                               
     d88P888 888 888          888     888                                          888  d8b  888          888      Y88b.               888                               
    d88P 888 888 888          888     88888b.  888 88888b.   .d88b.  .d8888b       888 d888b 888  .d88b.  88888b.   "Y888b.   88888b.  88888b.   .d88b.  888d888 .d88b.  
   d88P  888 888 888          888     888 "88b 888 888 "88b d88P"88b 88K           888d88888b888 d8P  Y8b 888 "88b     "Y88b. 888 "88b 888 "88b d8P  Y8b 888P"  d8P  Y8b 
  d88P   888 888 888          888     888  888 888 888  888 888  888 "Y8888b.      88888P Y88888 88888888 888  888       "888 888  888 888  888 88888888 888    88888888 
 d8888888888 888 888          888     888  888 888 888  888 Y88b 888      X88      8888P   Y8888 Y8b.     888 d88P Y88b  d88P 888 d88P 888  888 Y8b.     888    Y8b.     
d88P     888 888 888          888     888  888 888 888  888  "Y88888  88888P'      888P     Y888  "Y8888  88888P"   "Y8888P"  88888P"  888  888  "Y8888  888     "Y8888  
                                                                 888                                                          888                                        
                                                            Y8b d88P                                                          888                                        
                                                             "Y88P"                                                           888   

All Things WebSphere

Concerns and issues relating to all versions of WebSphere Application Server

Wednesday, December 28, 2011


IBM JVM and JDK -Xdump and -Xtrace options for scenario based problem determination

There are multiple ways of configuring the IBM JDK shipped by WebSphere Application Server to generate  WebSphere and JDK trace in situations where you have no control of the application or the server runtime.

Scenario 1: 
In a long running server when an exception occurs say a javax.transaction.RollbackException, we need to enable a particular WebSphere runtime trace for a period of 1 hour to collect pertinent logs. This allows for collection for logs ONLY and IF a critical incident occurs in long run and production deployment scenarios.

Using the JVM dump engine ability to run command lines based on events, you could trigger a command line on, say, the uncaught javax.transaction.RollbackException:
-Xdump:tool:events=uncaught.filter="javax/transaction/RollbackException",exec="command line to run"
Where we could then use wsadmin to change the trace settings:
exec="sh /opt/IBM/WebSphere/AppServer/bin/wsadmin.sh -lang jython -f setWASTrace.py"

For (setWASTrace.py) scripting with WebSphere Application Server see this blog post.

Scenario 2:
Print a thread stack trace whenever the method com.ibm.ws.util.ThreadPool$Worker.setStartTime method is called
-Xtrace:print=mt,methods={com/ibm/ws/util/ThreadPool$Worker.setStar tTime},trigger=method{com/ibm/ws/util/ThreadPool$Worker.setStartTime,jstack trace}

Scenario 3:
Print JVM entry and exit trace in clear text whenever any code is executed in the sun.net.www.protocol.http and sun.net.www.http packages

Scenario 4
Take Javacores when CPU Starvation is detected. This will write to a file named cpu_starvation%pid%.txt in the current working directory of the JVM (i.e. the same directory as the javacores) when CPUStarvationDetectedException is thrown
-Xdump:tool:events=throw,range=1..0,filter=com/ibm/loglistener/CPUStarvationDetectedException,exec="cmd /c c:\cpu_starvation.bat end %pid" 

Scenario 5
Take java stack traces when multiple methods are fired. This is useful to determine the root cause of memory leaks if one method allocates an object (i.e. puts in a map) and other method releases the resource (removes the object from the map)

-Xtrace:trigger=method{com/ibm/ws/webbeans/services/JCDIComponentImpl.storeCreationalContext,jstacktrace} -Xtrace:trigger=method{com/ibm/ws/webbeans/services/JCDIComponentImpl.releaseCreationalContext,jstacktrace} 


Tuesday, December 20, 2011


Perl script for finding invalidations in Dynacache Trace

Dynatrace.pl - Tool for finding invalidations in Dynacache Trace
This tool searches Dynacache Trace for invalidations and generates two CSV files.
This tool requires Perl. ActivePerl can be installed on Windows. The DateTime package is required.
The log to be parsed needs to contain Dynacache Tracing.

usage: C:\dynatrace.pl [OPTIONS] FILE

Trace should contain this trace:

Tool looks for this line:
  Cache.remove() cacheName=baseCache id=Customers cause=1 source=2

Filtering Options:

-i  | --instance CACHE_INSTANCE
  Tool uses the contains reg ex

-c  | --cause CAUSE
  Use either number of string
   0    UNSET
   1    DIRECT
   2    LRU
   3    TIMEOUT

-s  | --source SOURCE
   1    MEMORY
   2    REMOTE
   3    DISK
   4    NOOP
   5    LOCAL

  - FILE.inv.csv
  - FILE.inv.nonum.csv

  FILE.inv.nonum.csv can be used for grouping
Example Usage
C:\>dynatrace.pl --source REMOTE trace.log
-----> Grepping file: trace.log
-----> Filtering by source=REMOTE
-----> Processing: trace.log
-----> Writing trace.inv.csv
-----> Writing trace.inv.nonum.csv
-----> Log file format: Default - short
-----> Process trace.log file. Found 3443 invalidations
-----> Done
Download the tool from here ---------> Dynatrace.pl



Oracle’s Newly Unveiled WebLogic 12c Server

Oracle WebLogic 12 c (c stands for cloud) was announced on December 1st 2011. I would like to use this blog post to differentiate between WAS and the new launched WebLogic 12c.  Please take  an analytic look at the Oracle WebLogic Server 12c announcement  here. This article puts to rest any confusion regarding differences between WAS and WebLogic. For a comparison of which is faster WebSphere or WebLogic see.



Defensive queuing for website surge protection

Today's blog post explains a deployment and tuning methodology to protect your application server from a traffic surge.

In the figure below decreasing values are assigned to the tuning parameters for each of the displayed Web site components. This deliberate reduction in the maximum number of available resources assigned to each successive layer is called the Funnel model methodology. The benefit of the funnel tuning model is that we
want as many clients to connect to our system as possible, but without overwhelming the resources in each of the layers downstream (for example, database connections). The funnel helps us place these requests into various queues at each layer, where they will wait until the next layer has the capacity to process them. In summary, the funnel model helps us handle bursts of client

Queue tuning points in a Java EE Web site: the Funnel model
For some high level guidance  and theory see. The proportion and ratios  of the various queues to various another is very important in determining the queuing that occurs at load. If every incoming request requires a connection to a back-end database then  the  datasource connection pool  should be at least equal in size to the servlet thread pool.

What is the size of the WebContainer threadpool in relation to the connection pool  ?
What should be the IHS thread/process configuration in relation to the WebContainer threadpool ?

Answer from SWAT guru Kevin Grigorenko -->
  • The ideal proportion is 1:1 with all wait time on the network, but that assumes all layers perform and scale the same, which is rarely (if ever) the case, so only the general recommendation of 1:<=1 is made. Also, requests are not all the same, so one request may use more memory on a thread than others.
  • In general, I recommend customers "play it safe" -- for example, start at the max database concurrency, N, then set WAS WebContainer to 1.5N (could go more since a lot of times requests are just for static content) and then set IHS to 2N. 
  • But a lot of stress testing is required at the boundary of the incoming queues -- the biggest problem is that customers configure the front queue (e.g. IHS) at N but then don't even create a test that sends N concurrent requests in. When that happens (spike in load, DOS attack, etc.), their JVMs or database crash/OOM.



Using Java Server Faces 2 with WebSphere Application Server 7

If you want to use newer versions of Java Server Faces  i.e. JSF 2.x with WebSphere Application Server 7 or WebSphere Application Server 6.1 take a look at this blog post MyFaces 2.0 and WebSphere Application Server v7



December 2006   September 2008   January 2009   February 2009   March 2009   September 2009   October 2009   November 2009   December 2009   January 2010   February 2010   March 2010   April 2010   October 2010   January 2011   February 2011   April 2011   May 2011   June 2011   July 2011   August 2011   September 2011   October 2011   November 2011   December 2011   January 2012   February 2012   March 2012   April 2012   May 2012   June 2012   July 2012   August 2012   September 2012   October 2012   November 2012   January 2013   May 2013   June 2013   July 2013   September 2013   October 2013   June 2014   August 2014  

This page is powered by Blogger. Isn't yours?

Subscribe to Posts [Atom]