Load Test

Load Test, Profiling and Refactoring is the way to improve the performance of a web application

Posted on Updated on

Software engineering is not about particular technology like Java or Dot Net but it is all about the kind of standard practices we need to follow for production quality software. Recently I come across one of the practice during the performance testing of a web application. It would be helpful for other software developer, tester or devops.

Problem Definition: We have developed Asp.Net MVC 4 web application and we want to release it in production prior to that we need to  find out how much load it can take means how many concurrent users can access the web application and what is response time for each request during heavy load. We have agreed upon the response time should not be more than 3 seconds. This is common use case for all web application.

Solution: To solve it we have started with load testing, for that purpose we used the JMeter one of the open source load testing framework. We recorded the JMeter script. JMeter provided the user manual please refer it for more detail. We also want to monitor the server CPU and memory utilization for that purpose JMeter is having performance collection plugin and a server agent utility which captures the server parameters and sends it to the JMeter Plugin. JMeter has various listeners in which summary report gives the required statistics.

If the statistics are not satisfactory then it triggers the need to do profiling of a web application. By profiling we come to know various hot spots in the web application which very clearly state the resource utilization of every method and class. We have used the dotTrace from Jetbrains it provides the 10 days trial edition. Every language is having the profiling support so you choose which ever fit for you but objective is the same.

Now we have profiling result which triggers the need of re factoring of code. The re-factoring is common practice in agile which help to evolve the design and architecture of software. This activity triggers to implement particular task in more efficient way. This is totally depends on your business logic, design and architecture of software.

We need to repeat this cycle Load Test –> Profiling –> Re factoring until you will not be satisfactory with result. But one thing is very sure that you will have performance efficient software with good design and architecture.

performance tunning cycle

Remaining performance tuning can be done at web server level like increase number of worker and IO threads per process, increase the request queue length and if required add the load balancers etc.

Once you got the required result you can not hide smile on your face 🙂 i.e. “AANAND”

References

  1. http://jmeter.apache.org/usermanual/component_reference.html
  2. http://jmeter-plugins.org/wiki/PerfMonAgent/
  3. http://jmeter-plugins.org/wiki/PerfMon/
  4. http://www.jetbrains.com/profiler/
  5. http://refactoring.com/