This page last changed on Sep 13, 2006 by mryall.

Introduction

There is a plugin for Confluence 2.2 and later which allows easy profiling using the YourKit profiler. No license is required to generate a profile dump, but you will need at least an evaluation license to analyse the results.

JIRA also has a plugin to profile JIRA's CPU and memory usage with YourKit.

Configuring YourKit in your JVM

Download YourKit for your platform, and follow the installation instructions.

Your JVM will need to be configured to use the profiler. For the Sun 1.5 JVM on Linux, this is done with the agentlib parameter and by including the installation directory in the LD_LIBRARY_PATH environment variable, as shown below:

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/path/to/yourKitAgent
java -agentlib:yjpagent ...

For configuration for other JVMs and platforms, see the YourKit documentation which is bundled with the installation.

Installing the YourKit plugin

Download the plugin and upload it into Confluence through the Administration, Plugins page.

A new menu option will appear under the 'Administration' heading. Click it and you should see the option to take a memory dump.

This profiler dump will be saved to a local temp directory, and the path shown once it is complete.

Why would I do this?

Analysing a profiler dump enables Atlassian Support (or you, if you are interested) to see exactly what is happening in your application: what classes are using the memory, what is using CPU and so on. This can help us debug tricky performance problems which would otherwise be impossible to analyse remotely.

Plugin source code

The source code for this Confluence plugin is available from Subversion and browseable in Fisheye. To rebuild the JAR attached to this page, you need to run maven jar, and then extract the YourKit controller dependency (yjp-controller-api-redist-5.5.3.1.jar) and include that in the 'mashed' JAR too.


YourKitMenu.png (image/png)
yourkit-mashed-plugin-0.1.jar (application/octet-stream)

Instructions available in this sections are not clear.

Here are the steps that I have followed to install Yourkit plugin for Confluence Wiki (2.2.4) on Linux using JDK 1.4 on Tomcat Application Server 5.0:

  1. Download yourkit for OS platform on which you want to run and install it
    unzip yjp-6.0.4.zip
  2. set LD_LIBRARY_PATH path
    First find out the path where libyjpagent.so file is present for given OS.
    <homedir>/yjp-6.0.4/bin/linux-x86-32/ is place where you will get libyjpagent.so file with reference to Linux with x86 platform
  3. Now we want to configure the Tomcat application server for Yourkit
    Since we are using JDK 1.4, go to tomcat/bin
    And modify "startup.sh" (in order to refer to yourkit library) as follows:
    export CATALINA_OPTS="-Xms256m -Xmx1700m -DmyName=Confluence -Djava.awt.headless=true -Dbucket.indexing.threads.fixed=5 -Xrunyjpagent:onexit=memory,dir=/users/wiki"

    or refer to http://confluence.atlassian.com/display/JIRA/Setting+Up+YourKit+Agent+Parameter
    Snapshots will be stored in directory set as "dir"

  4. Then install Yourkit plugin for Confluence Wiki

Hope this helps.

Few questions that I have still are:

1. Current Confluence Yourkit plugin has only one option i.e. to take the Memory snapshot. It doesn't explain how one can take the CPU Snapshots.

2. Also bit strange but worth to mention; whenever we ran the Yourkit plugin to take the memory snapshot, Apache has exceeded the max threads available due to which Wiki was inaccessible. Only way to restore the order was to restart tomcat, Apache.

hope this information helps for everybody!

regards,
Rajendra

Posted by rakadam at Jan 17, 2007 19:27
Document generated by Confluence on Mar 22, 2007 20:55