Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to profile a distributed app in java?

I've got an app running on a grid of uniform java processes (potentially on different physical machines). I'd like to collect cpu usage statistics from a single run of this app. I've went over profiling tools looking for an option of automatic collection of data but failed to find any in netbeans, tptp, jvisualvm, yourkit etc.

Maybe I'm looking in a wrong way?

What I was thinking is:

  • run the processes on the grid with some special setup that allows them to dump profiling info
  • run my app as usual - it will push tasks to the grid, the processes will execute the tasks and publish profiling info
  • uses some tool to collect and analyze the profiling results

but I can't find anything even remotely similar to this.

Any thoughts, experience, suggestions?

Thank you!

like image 992
atamur Avatar asked Apr 22 '11 12:04

atamur


People also ask

What is profiling Java application?

Profiling is the process of examining an application to locate memory or performance-related issues. When profiling a Java application, you can monitor the Java Virtual Machine (JVM) and obtain data about application performance, including method timing, object allocation and garbage collection.

Is JConsole a Java profiler?

JConsole is a built-in Java performance profiler that works from the command-line and in a GUI shell.

Is Eclipse profiler a Java profiler?

Java profiling in Eclipse allows you to optimize your code, streamline your application, and better understand your program.


1 Answers

If you have allowed remote JMX access and if you are using SUN JDK 1.6 then try using jvisualvm. It has the option of remote JMX connection. Though I haven't it used for profiling CPU in a distributed environment.

Note: For CPU profiling your application should be running on SUN JDK 1.6 or above.

enter image description here

Have a look at these links:

  1. JVisualVM
  2. JVisualVM - Working with Remote Applications
  3. Get heap dump from a remote application in Java using JVisualVM
  4. Unable to profile JBoss 5 using jvisualvm
  5. http://www.taranfx.com/java-visualvm
like image 195
Favonius Avatar answered Oct 04 '22 03:10

Favonius