Wednesday, May 20, 2015

How to get Thread Dumps from java application and how to analyze them

Thread dmps can say a lot about your application, but without a tool to do analysis on them are useless.
We will focus on how to get thread dmps from jboss application server as example, and how to analyze them.

First thing you need to do is get the processId of your jboss application, we can use something like this:

That will return the process which contains jboss on their data.


Now that you have the processId is just matter of call this jstack command to get the thread dmp



This will create a file called thread_running.out which is the actual thread dmp.

now a single thread dmp is not that useful, so I suggest you get several ones of the application your want to know about.

Once you have a several of them is time to analyze them.

There are several options, online tools, stand alone programs, but there is an eclipse plugin that is very friendly is called lockness, just go to the site and follow the steps to install it.

There is a bad thing, Luna does not support this, I bet that there is a work around for it, but I do not have that, so I used it on Kepler version.

Once Lockenss is installed you can see your thread dmps files in an eclipse window as follows:

Then you can see each thread dmp file inside eclipse, see dependencies between threads, deadlocks, threads waiting and what do started them, this will help you to trouble shoot faster an odd issue about a long running thread or dead locks on your application.






Special Thanks to Lockness plugin for exist.

Performance Monitor (ATG Oracle Commerce)

Sometimes after development is done, performance test will happen to prove your application does load fast enough for your end client, and does support high loads.
ATG does provide a tool to Monitor your application, it is called Performance monitor, you can get this inside /dyn/admin on main menu, or going to
http://server:port/dyn/admin/atg/dynamo/admin/en/performance-monitor.jhtml
By default is disabled


Just Enable it by clicking on Performance Monitor Configuration;

I usually use the TIME monitor, which is the more easy to understand and is the one we will focus on this post.

There are 3 notes at the end, do not ignore them.

Once Performance monitor is enable it is matter of browse into your site, to start Monitoring activity

Getting performance monitor page again http://:/dyn/admin/atg/dynamo/admin/en/performance-monitor.jhtml 
the results will be different:

It will display a list of operations along with stats for all of them, the ones that are more important are the Number of executions and Total Execution time, this will give you an idea on what are the heavy operations. for example Service Request will be one of the operations that take most time. if you click on it you will see a view like the this:

All requests that are executed and the time that took for all of them, this will give you an idea on what .jsps you can look into based on Number of executions and Total Execution time.

There is an other item on the operations list that is the time that dsp: includes are taking:


and at last but not least you can see what non cached queries or get Item are happening behind the sense this will help you to improve your item-cache-size on your repository definition:


There are a lot of operations that you can monitor, the ones on this post are just examples of how Performance Monitor helps you to identify things that you can fix inside your application.

Wednesday, May 13, 2015

How To Optimize your Web Site at Front-End

I have been working a little bit on improve the performance of one our applications and I have found good stuff out there that I would like to share such as these Check Lists for your Front-End files side of the application.

There is a withepaper at dzone about this, this is just a very small framgent of this document, you can get this at http://www.dzone.com/links/index.html