Friday, March 16, 2007

Tuning BPEL with JVMStat

Since Java version 1.4 a nice tool is available to monitor the behavior of the JVM. This can also be applied on BPEL. While BPEL is running on top of the JVM. The tool is called JVMstat and is available via the Sun website.

It works as follows. On the application server a daemon program must be run. This program is collecting information from the running JVM's. Via a visual tool, supplied with JVMStat, the behavior of the JVM is shown in a graphical way.

We assume that the JVMStat daemon is running on your application server, on which SOA Suite 10.1.3 is running, and the JVMStat visual tool running from your workstation. This is shown in the following diagram.


Download JVMStat from the the Sun website, unzip the file into a directory on your workstation and copy the zip file to your server and unzip it there as well.

Create a policy file on the server. This file is needed to set the appropriate rights for JMVStat. Create a file named "jstatd.policy". The content of the file must be:

grant codebase "file:$ORACLE_HOME/jdk/lib/tools.jar"
{

permission java.security.AllPermission;
};

Replace $ORACLE_HOME with the full directory path.

On the server you can start the daemon process.

jstatd -J-Djava.security.policy=jstatd.policy

Note that the daemon process is using the policy file, we just created.

Now you can start the visual user interface. This is done by starting the program 'visualgc.cmd' on the workstation. Therefore you must known the process-id of the JVM on which the SOA Suite is running. Use, assuming you run a unix environment, the 'ps -ef | grep java' command to found the process id.

Start the visual tool as follows:

visualgc.cmd @

For example:

visualgc.cmd 3219@linuxmachine.local.site

2 comments:

Anonymous said...

Hi, The ID of an OC4J process can also be found from the ASConsole. You can go to the oc4j container and look at the JVM Metrics.
On windows you can find the PID from the taskmanager. If you don't see it (default) you can add it from the view menu / select columns.
On windows there is one difficulty that opmn is started default as a system user. If you run the visualgc.cmd , you will run it as you. You will not be able to see the oc4j process.. For a workaround (that I have not tested) look at http://java.sun.com/performance/jvmstat/faq.html

Anonymous said...

Hi Mark, In your post you have just described how to attach visualgc to OC4J container. But I would appreciate more information on actual BPEL tunning:
- how to increase throughput
- how to avoid OutOfMemory errors, thread starvation etc.

Once visualgc has been attached, what parameters should I watch? As far as I know, BPEL creates many short-lived objects. Here, the increasing of eden space may be reasonable. What about other parameters?

Post a Comment

Post a Comment