Tuesday, May 27, 2014

Performance Analysis - Part 4

When it comes to bottleneck isolation, first doubt the configurations/settings in web server, app server and db server. Top items you must check, before getting into code level, are:
  1. Webserver max connections
  2. jvm heap memory max settings
  3. Web server cache limit
  4. Database indexes for most frequently used queries
  5. Database max connections
  6. Swap file settings of the machine
The above one is not the complete list. But these are some key items, that most of us will forget to check. Once these things are resolved, we need to get into the application code level. But a performance tester may not know all the details in code. No worries. There are tools, that can get into the code and tell you where is the problem.

These tools are called APM (application performance monitoring) tools. There will be an agent and we must install that in our servers. These agents will send finer details to the tool's central database, and that will show the problem areas.

Look at the following image.

This is taken from the profiling tool. These tools run on servers and collect deep-dive data. The load testing tools will give stats for the pages. If you look at this image, it has jsp details as well as details for LoginAction, LookupAction, TaxAction etc. The Action is a java code that is done at the server level. When load test is going on, this will measure the time taken by server side functions, and provide details.

From this, we can see main.jsp and LoginAction are the most time consuming ones, that the others. So we must get deep into those and find the issues. To drill down a top level function is known as transaction trace. 

Look at this transaction trace.

This trace clearly tells what are the calls made within the LoginAction, in the same call sequence. From this we know how many java calls are made and how many database calls are made. How many times the calls are made and the time taken for the calls are clearly provided.

Come on, what else you need to identify the bottleneck? Go thru transaction by transaction, go thru the trace and find the function calls or database calls that take the maximum time. Tell your dev team to touch those functions for better performance.

How do you find this? If you say that this is not interesting, your emotion levels are to be checked!