How to remotely profile a web application with JProfiler?
Asked Answered
C

1

17

I am running a web application that is deployed on remote machine server and I have the IP address and URL of this application. When I hit the URL with a browser, the application displays.

I now have to profile that web application, as I need to find out why it is running so slow.

I tried using JProfiler, have not been successful. Could someone please advise how to configure JProfiler for remote profiling?

Cupellation answered 18/10, 2012 at 2:33 Comment(2)
You might want to add some detail on what you have done so far with JProfiler, so that we can better understand where you are at right now.Enfold
resources.ej-technologies.com/jprofiler/help/doc/…Consummate
H
21

The easiest way to profile a remote JVM on a system without a GUI is this:

  • Extract the JProfiler archive (not the installer) somewhere on the remote machine
  • In the installation directory call bin/jpenable and select the JVM you want to profile
  • On your local machine start JProfiler and create a new session of type "Attach to profiled JVM (local or remote)"
  • In the session configuration, enter the host name and the port as given by jpenable
  • Start the session and profile

Tip: To find a bottleneck, use sampling not instrumentation.


Update for JProfiler 10.0+

Since JProfiler 10.0, there is a remote attach feature that does not require any of the above steps, you just need SSH credentials to the remote machine.

enter image description here

SSH connections are made directly by JProfiler, you don't have to set up the SSH tunnel yourself. It's also possible to configure multi-hop tunnels.

JProfiler will automatically download the required agent package, upload it to the remote machine and use its command line tools to gather the information that you see in the attach dialog. The agent package is cached, so this is only done once.

enter image description here

Because you have to authenticate as the same user that has started the JVM that you want to profile, it is possible to switch the user for the remote attach. For example, you can sudo to the root user to attach to a service that was started as root.

enter image description here

All the JVMs started by the selected user are shown and you can either start a full profiling session or just take a low-overhead HPROF heap dump and open it in JProfiler.

enter image description here

Hazan answered 18/10, 2012 at 7:59 Comment(7)
Kegal when I start jpenable then it ask for search jvm and then I enter yes then it showing me No unprofiled JVMs found please suggest what's wrongPeay
JProfiler expects the user running the jvm to have an enviroment. I suppose it's a bug, I mean, for example, it wants to be able to install software to an inexistent /home/tomcat/.whateverRomie
@Romie It does not install any files, but the attach mechanism uses the $TMP directory, so that must exist and be writable by the user.Hazan
It tries to install jpenable in the home of the user running the java runtime. EDIT: It even says so in the GUI -> $HOME/.jprofiler10Romie
Yes, indeed, I have just added info for the SSH attach. It does not apply to list of manual steps at the top of the answer.Hazan
@IngoKegel I tried to connect remote server using JProfiler, the first time I can connect remote server but again I tried to connect process show highlighted red color. the error message shows there is another JProfile GUI caught this session. how to detached JProfiler GUI.Lepidopterous
There are situations in VPNs where the agent does not detect a broken connection. Unfortunately there is currently no way to tell the agent to reset the connection and the only way is to restart the profiled JVM.Hazan

© 2022 - 2024 — McMap. All rights reserved.