Tuesday, January 31, 2012

How to calculate sessions per hour in performance testing? - Little's Law

Calculating Sessions per hour: For this discussion, we will be focusing on a session as the total time for the user group to finish one complete set of transactions. We may wish to know the number sessions that will be completed for any given number of virtual users.

  • Example 1:- If a baseline test shows that a User Type takes a total of 120 seconds for a session, then in an hour long steady state test this User Type should be able to complete 3600 / 120 = 30 sessions per hour. Twenty of these users will complete 20 x 30 = 600 of these session in an hour. In other cases, we have a set number of sessions we want to complete during the test and want to determine the number of virtual users to start.
  • Example 2:Using the same conditions in our first example, if our target session rate for sessions per hour is 500, then 500 / 30 = 16.7 or 17 virtual users. A formula called Little's Law states this calculation of VirtualUsers in slightly different terms.
  • Using Little's Law with Example 2:
    wV.U. = R x D where R = Transaction Rate and D = Duration of the Session
    If our target rate is 500 sessions per hour (.139 sessions/sec) and our duration is 120 seconds, then Virtual Users = .139 x 120 = 16.7 or 17 virtual users.

Tuesday, January 17, 2012

How to do performance measurements of system using perfmon

The PerfMon sample is an introduction to performance counters. It demonstrates how to monitor local or remote system performance. It shows how to dynamically create timers, context menus, and graphic displays. Follow the below mentioned steps to monitor the windows system performance counters

1. Open the Perfmon on Windows -> start ->run -> Open-> type "perfmon" and press enter
2. Expand Performance Log and Alerts
3. Select Counter Logs
4. Right Click on “Counter Logs” and Select “New Log Settings”
5. Enter the desired name for your machine (Web Server1 or App Server1 etc) for monitoring
6. Dialog pops up with the name you have mentioned
7. Select the General Tab
8. Give the optimum interval based on the based on the duration of the test
9. Click on Add Counters button
10. Select the Performance Object (Ex: Processor, System, Network etc.)
11. Select the counters from the list (Talk to Administrator of the respective admin team to identify the best required monitors)
12. Click on Add
13. Repeat the Step 8 to 11 till all the necessary counters are added
14. Select the Log Files tab on Server counters dialog
15. Select the log file as Text File (comma delimited)
16. Click on configure button if you want to change the log files location
17. Press OK Button on Configure Log Files dialog
18. Press OK
19. Browse the folder (Default C:\Perfmon)
20. Open the .csv file in excel format
21. Generate the graphs and save as excel

Performance case studies

Case study 1:
We need to test the application which has 50,000 user traffic in 1 hour and each user transaction compromises of 7 page assuming each transaction takes 30 min.

Solutions First of all each user will not perform activity in 30 minutes. He will be in the state of think time (most of the time). Let’s take each page time taken to complete is 10 sec.

Also 50,000 user will perform 50,000 transactions/iterations.
1 user -> 7 Pages-> 1 page (10sec)-> 7pages=>7*10 =>70 seconds
1 user in 1 hour will have go 3600*70=>51 iterations
So for 50000 transactions/iterations => 50000/51 => 981 users approx.

So if your tool capability is not upto 50,000 user and you need to test application for 50,000 users , Go by explained strategy or if you have your tool capable with 50,000 user load, then go by original no. of users.

Other way solution of this problem can be that ask your web server administrator that how much no. of http hits application is going to get in the peak time of the activity and then go by goal –oriented scenario in Loadrunner.