Pergunta

I have a client which is Multithreaded code and which is hitting one of my REST service which is being deployed to this machine-

http://px5qa01c-8539.host.com:8080/service/TEService/v1/get/USERID=100/PURCHASED

I have remote access to the above machine and it's a Linux host.

Now I am planning to do profiling on the Server Side on my REST Service meaning I need to see which methods is taking how much time on my REST Service.

On the client side I am running program like this- which will hit my REST Service that I have deployed on the above machine.

java -Xrunhprof:cpu=samples,thread=y,depth=12,cutoff=0 -jar ServiceLnP.jar service_config.properties NUMBER_OF_THREADS:20 TOTAL_RUNNING_TIME:60

So on the client side, it will generate java.hprof.txt file which I can open with HP Jmeter and analyze it.

Problem Statement:-

But on the server side what should I do? What's the best way to profile the applications that has been deployed on some other machine.

Just FYI- The container on which it is deployed is Geronimo. So is there any way, I can enable hprof on the server as well and as soon as I am hitting my REST Service after it finishes, it will generate java.hprof.txt that I can analyze further?

Foi útil?

Solução

It really comes down to the tool you're using, and they provide different solutions. Quite often, they will listen on a port in the server-side JVM, which the tool attaches tool. Some tools touch the classes to add extra information, some can profile the application without modification.

I've used JProfiler in the past, which was very good. It is a commercial tool, though. So there is a cost. I've used NetBean's profiler as well with good results. It is a free application, so there's no cost there. JavaMelody looks good as well as suggested by Piotr, although I don't have any personal experience with that.

You'll just need to grab a tool and try it out.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top