Using YourKit Java profiler at the CEDAR cluster

Remote Java profiling with YourKit guide by Paweł Guzewicz

PLEASE READ THESE INSTRUCTIONS ENTIRELY BEFORE APPLYING THEM!

——————————————————————————–

SETUP STEP
You need to configure the YourKit Profiler client at the local machine.

In YourKit client add a new connection as follows.
In the Main tab:
(a) Fill in the host address as cedar0xx.saclay.inria.fr (replace xx accordingly).
(b) Choose an advanced application discovery method. Use your Inria username as an SSH user, and put the port 22.
(c) Click on authentication settings and choose the private SSH key that you use to connect to the cluster.
In SSH Tunnel tab:
(d) Add an intermediate node cedarfront.saclay.inria.fr with port 22.
(e) Specify the username as in (b), and change authentication settings as in (c).

Troubleshooting
YourKit only supports one kind of RSA key format, and in some cases fails to connect to the cluster. To solve this problem, you can convert your private key using the following script.

Inside your .ssh directory at the local machine (assuming id_rsa is the name of the private key you use), run:

cp id_rsa id_rsa_yourkit
ssh-keygen -p -f id_rsa_yourkit -m pem

As a result, id_rsa_yourkit is generated based on id_rsa and should work now. Remember to choose id_rsa_yourkit in authentication settings in both Main and SSH Tunnel tabs.

Finally, at the cluster, download the YourKit archive and unpack it in your home directory.

——————————————————————————–

1. Launch the run script at the cluster. The Java application has to start first, then we can start profiling it.

2. In a separate terminal window, attach the profiler to the Java process inside the YourKit directory at the cluster by running:

./bin/attach.sh $(ps aux | grep ‘target/Spade-1.0-SNAPSHOT-with-dependencies.jar’ | grep -v grep | cut -d’ ‘ -f2)

This script is supposed to discover the process id and attach the remote profiler agent to the running java instance. (Sometimes you may need to replace -f2 with -f3, etc., depending on the output of ps aux command.)

3. Connect to the profiling session running at the cluster using the YourKit client at your local machine.

Comments are closed.