Table of Contents



There are some parameters which can provide quantitative data about the performance of your application. These parameters work in sync with each other. For example you can’t have same avg. response time by increasing or decreasing the maximum number of concurrent users. Every new project should include these parameters in non-functional requirements. If you are outsourcing your work, make sure to provide values for these parameters and ask the supplier to meet them. I have seen companies which ask the supplier to demonstrate how will they be able to meet these requirements.

The following are the parameters to be discussed when trying to standardize and measure the performance of a web application.

1) Number of concurrent users

Concurrent users is the number of users with active session at a given point of time. If your application allows duplicate user sessions then count them twice for measuring. This parameter is usually derived from business requirements. For example in a portal, one can come up with an expected number of 2000 concurrent users. This means that the application designer and developer should take appropriate steps to make sure that 2000 sessions can be active at any time. Given these many concurrent sessions, the requirement for other parameters like requests per minute should also be met. If in above example, 5000 concurrent users are trying to log in, then the designer and developer shouldn’t be responsible for poor performance on other parameters.

Tips:

  • Set Java heap size of the server to handle session data of maximum allowed concurrent users to avoid persistence.
  • Configure database connection pool size accordingly.
  • Provide appropriate value for max number of server connections in config files like server.xml in case of tomcat.
  • Application should have the provision to disable access to itself once the maximum number of concurrent sessions are active. This can be achieved by writing filters and session listener in case of Java web applications.

Testing:

  • Use testing tools like JMeter and LoadRunner.
  • Write scripts to simulate the real world scenario of disallowing access once the maximum number of user sessions are active.
  • Increase session timeout to perform manual testing.

2) Average Response time

The response time for user requests is in the hand of designer and developer. With high end hardware and web servers, applications can be designed to achieve very low response times. There are a number of things which play a significant role in deciding the response time. These include network connections, caching, clustering etc. One important point to note here is that response time usually decreases with increase in number of users using the application (requests per minute). The following chart shows how response time varies with requests per minute.

Measuring performance of web application

Tips:

  • 80% of applications can meet avg. response time criteria if designing and coding doesn’t involve silly mistakes. Many a times, developers will write bad SQL queries to add unnecessary looping, conditions, file handling and network activity which adds up and makes application perform poor.
  • As a developer, one should also take into account client side rendering of UI. This is more important due to the time spent in JavaScript code execution in Rich Internet Applications.

Testing:

  • The avg. response testing has to be done for a large number of requests with low, medium and peak load.
  • There are a number of automated testing tools to provide the value of avg. response time like Apache JMeter and AppPrefect.
  • One can even perform black box testing by measuring response time for parts of a request. This could involve measuring database response time, time spent on initializing objects (think lazy/early loading) and running a test on the local cache (if used).

3) Handling peak load

There are special times when the load on your application exceeds all estimates. For example : Last date to enroll online for post graduate exam, the day results are published online etc. During this time, your application can easily deny users due to multiple reasons. A very common example is exceeding allowed bandwidth of the server for the month.

A very good solution to handle such scenario is to visualize the same in advance and host your application and data on multiple servers aka mirrors. You can either provide the user an option to choose the server from where he wants to get data or write logic to detect the location of user and forward him to nearest mirror.

4) Network bandwidth requirements

The bandwidth requirements for an application depend upon how rich and heavy components are added to the UI. If you have a lot of audio, video and image data to be loaded on the client machine then you need to handle the same differently. The options available for resource heavy UI include:

  • Browser caching:
    With browser caching, the same resources are not downloaded for every request.
  • Content Delivery Networks :
    With CDN, you host the content on geographically spread servers and make the user download content from nearest server to him.
  • On Demand Loading :
    You make the user download content only when he really needs it. A good example is loading of images/video as user scrolls down in web browser.

Usually for enterprise level applications hosted on the internet, companies roll out hi-fi and simple versions of their applications. The version being shown to user depends upon his network bandwidth (think of Gmail).

5) Capability to handle more number of users

Given the expected values for the rest of parameters, it is interesting to note how well your enterprise application can scale. A good design is the one which takes into consideration the need to meet the popularity of an application. This involves how the application has been designed.

For example, the designer may decouple the front end and business logic by creating multiple layers and make the application capable of say moving to mainframe with minimal effort.

It is worth to note here that capability to scale in terms of users doesn’t mean that your application is already ready to scale up. It means how difficult will it be to scale up. No magic can be done to make the app. handle unlimited number of users. Its about how well you and your app. is prepared to handle increase in number of users and hence a increase in the above 4 parameters.

References

1. Fundamentals of Web Application Performance Testing
2. Improve the performance of your web applications
3. How your Web App is performing

Performance Management in web applications admin Java EE
Table of Contents 1. Number of concurrent users 2. Average Response time 3. Handling peak load 4. Network bandwidth requirements 5. Capability to handle more number of users 6. References There are some parameters which can provide quantitative data about the performance of your application. These parameters work in sync with each other. For example you...
Table of Contents <div id="toc"> 1. <a href="#concurrentusers">Number of concurrent users</a> 2. <a href="#avgresponsetime">Average Response time</a> 3. <a href="#handleload">Handling peak load</a> 4. <a href="#networkbandwidth">Network bandwidth requirements</a> 5. <a href="#users">Capability to handle more number of users</a> 6. <a href="#references">References</a> </div> <br/><br/> <p>There are some parameters which can provide quantitative data about the performance of your application. These parameters work in sync with each other. For example you can't have same avg. response time by increasing or decreasing the maximum number of concurrent users. Every new project should include these parameters in non-functional requirements. If you are outsourcing your work, make sure to provide values for these parameters and ask the supplier to meet them. I have seen companies which ask the supplier to demonstrate how will they be able to meet these requirements. The following are the parameters to be discussed when trying to standardize and measure the performance of a web application. </p> <a name="concurrentusers"></a> <h2>1) Number of concurrent users</h2> <p>Concurrent users is the number of <a href="http://www.javaexperience.com/java-ee-how-session-tracking-works/">users with active session</a> at a given point of time. If your application allows duplicate user sessions then count them twice for measuring. This parameter is usually derived from business requirements. For example in a portal, one can come up with an expected number of 2000 concurrent users. This means that the application designer and developer should take appropriate steps to make sure that 2000 sessions can be active at any time. Given these many concurrent sessions, the requirement for other parameters like requests per minute should also be met. If in above example, 5000 concurrent users are trying to log in, then the designer and developer shouldn't be responsible for poor performance on other parameters.</p> <p> <h3>Tips:</h3> <ul> <li style="list-style-image: url(/checkmark.gif);margin-left: 30px;">Set Java heap size of the server to handle session data of maximum allowed concurrent users to avoid persistence.</li> <li style="list-style-image: url(/checkmark.gif);margin-left: 30px;">Configure <a href="http://www.javaexperience.com/connection-pooling-in-tomcat/">database connection pool</a> size accordingly.</li> <li style="list-style-image: url(/checkmark.gif);margin-left: 30px;">Provide appropriate value for max number of server connections in config files like server.xml in case of tomcat.</li> <li style="list-style-image: url(/checkmark.gif);margin-left: 30px;">Application should have the provision to disable access to itself once the maximum number of concurrent sessions are active. This can be achieved by writing filters and session listener in case of Java web applications.</li> </ul> <h3>Testing:</h3> <ul> <li style="list-style-image: url(/checkmark.gif);margin-left: 30px;">Use testing tools like JMeter and LoadRunner.</li> <li style="list-style-image: url(/checkmark.gif);margin-left: 30px;">Write scripts to simulate the real world scenario of disallowing access once the maximum number of user sessions are active.</li> <li style="list-style-image: url(/checkmark.gif);margin-left: 30px;">Increase session timeout to perform manual testing.</li> </ul> </p> <a name="avgresponsetime"></a> <h2>2) Average Response time</h2> <p>The response time for user requests is in the hand of designer and developer. With high end hardware and web servers, applications can be designed to achieve very low response times. There are a number of things which play a significant role in deciding the response time. These include network connections, caching, clustering etc. One important point to note here is that response time usually decreases with increase in number of users using the application (requests per minute). The following chart shows how response time varies with requests per minute.</p> <img src="http://www.javaexperience.com/Requests Per Minute vs Response Time.jpg"/ alt="Measuring performance of web application"> <p> <h3>Tips:</h3> <ul> <li style="list-style-image: url(/checkmark.gif);margin-left: 30px;">80% of applications can meet avg. response time criteria if designing and coding doesn't involve silly mistakes. Many a times, developers will write bad SQL queries to add unnecessary looping, conditions, file handling and network activity which adds up and makes application perform poor.</li> <li style="list-style-image: url(/checkmark.gif);margin-left: 30px;">As a developer, one should also take into account client side rendering of UI. This is more important due to the time spent in JavaScript code execution in Rich Internet Applications. </li> </ul> <h3>Testing:</h3> <ul> <li style="list-style-image: url(/checkmark.gif);margin-left: 30px;">The avg. response testing has to be done for a large number of requests with low, medium and peak load.</li> <li style="list-style-image: url(/checkmark.gif);margin-left: 30px;">There are a number of automated testing tools to provide the value of avg. response time like Apache JMeter and AppPrefect.</li> <li style="list-style-image: url(/checkmark.gif);margin-left: 30px;">One can even perform black box testing by measuring response time for parts of a request. This could involve measuring database response time, time spent on initializing objects (think lazy/early loading) and running a test on the local cache (if used).</li> </ul> </p> <a name="handleload"></a> <h2>3) Handling peak load</h2> <p> There are special times when the load on your application exceeds all estimates. For example : Last date to enroll online for post graduate exam, the day results are published online etc. During this time, your application can easily deny users due to multiple reasons. A very common example is exceeding allowed bandwidth of the server for the month. A very good solution to handle such scenario is to visualize the same in advance and host your application and data on multiple servers aka mirrors. You can either provide the user an option to choose the server from where he wants to get data or write logic to detect the location of user and forward him to nearest mirror. </p> <a name="networkbandwidth"></a> <h2>4) Network bandwidth requirements</h2> <p> The bandwidth requirements for an application depend upon how rich and heavy components are added to the UI. If you have a lot of audio, video and image data to be loaded on the client machine then you need to handle the same differently. The options available for resource heavy UI include: <ul> <li style="list-style-image: url(/checkmark.gif);margin-left: 30px;"><strong>Browser caching:</strong> With browser caching, the same resources are not downloaded for every request.</li> <li style="list-style-image: url(/checkmark.gif);margin-left: 30px;"><strong>Content Delivery Networks :</strong> With CDN, you host the content on geographically spread servers and make the user download content from nearest server to him.</li> <li style="list-style-image: url(/checkmark.gif);margin-left: 30px;"><strong>On Demand Loading :</strong> You make the user download content only when he really needs it. A good example is loading of images/video as user scrolls down in web browser.</li> </ul> Usually for enterprise level applications hosted on the internet, companies roll out hi-fi and simple versions of their applications. The version being shown to user depends upon his network bandwidth (think of Gmail). </p> <a name="users"></a> <h2>5) Capability to handle more number of users</h2> <p> Given the expected values for the rest of parameters, it is interesting to note how well your enterprise application can scale. A good design is the one which takes into consideration the need to meet the popularity of an application. This involves how the application has been designed. For example, the designer may decouple the front end and business logic by creating multiple layers and make the application capable of say moving to mainframe with minimal effort. It is worth to note here that capability to scale in terms of users doesn't mean that your application is already ready to scale up. It means how difficult will it be to scale up. No magic can be done to make the app. handle unlimited number of users. Its about how well you and your app. is prepared to handle increase in number of users and hence a increase in the above 4 parameters. </p> <a name="references"></a> <h2>References</h2> 1. <a href="http://msdn.microsoft.com/en-us/library/bb924356.aspx" target="_blank">Fundamentals of Web Application Performance Testing</a> 2. <a href="http://www.ibm.com/developerworks/web/library/wa-webappperformance/" target="_blank">Improve the performance of your web applications</a> 3. <a href="http://newrelic.com/application-monitoring" target="_blank">How your Web App is performing</a>