Tuesday, September 9, 2014

Remote Profiling WSO2 Servers in Headless Mode with JProfiler

When a WSO2 product like Identity Server is installed on a server that runs a a server class Operating System that has no GUI (Headless), you cannot directly profile it using a tool like JProfiler as you cannot load the JProfiler application with GUI on that server. If the server has GUI available, then profiling can be done following [1]. This post explains steps for remote profiling the WSO2 server with JProfiler.

In this example I am using WSO2 Identity Server 3.2.3 installed on Centos-6.5x86_64 and JProfiler8. The JProfiler GUI runs in an Ubuntu PC.

First, get JProfiler installed on both the remote server and your PC. It is recommended that you install the same version of JProfiler on both the machines.

Then start the WSO2 server on the remote machine. If it is already running, no need to start again.

Navigate to the bin directory of the JProfiler installation directory. Run the jpenable script. Select GUI mode (attach with JProfiler GUI) when it prompts and enter a profiling port.



Next step is to run the JProfiler GUI in your PC. Go to 'Session' in the menu and select 'New Session'.


In the Session Settings window that opens next, select the 'Attach to profiled JVM (local or remote)' option. For the Host, enter the IP address of the remote server that you want to profile. For the Port, enter the same port number you entered when you ran the jpenable script on the remote server.


Continue to the 'session Startup' window.


Now you can start profiling the WSO2 server running on a remote server.


[1] : http://udaraliyanage.wordpress.com/2013/06/29/profile-wso2-servers-using-jprofiler/

~Tharindu Edirisinghe
Identity Server Team
WSO2