Step 1: Identify System Configuration
Identify and set up the system configuration in which your web application
should run to measure the performance statistics. For example, run your
web application in two machines, PIII 1 GHz 512 MB RAM and PIV 2 GHz 2
GB RAM. This will help you to compare the two system configurations and
identify which one performs better and meets the expected performance
criteria in which you can host your web application.
Step 2: Identify Key User Scenarios
Identify the key user scenarios or user transactions that a real-world
user would perform and that are critical for your web application from
a performance perspective. User scenarios include multiple application
activities. Key user scenarios are identified based on specific performance
goals such as transactions that consume time or those that have a significant
impact on your application's performance. One such user scenario is determining
the approximate time required to process a user transaction and returning
the results. For example, processing the credit card details and
returning the status takes approximately 5 seconds, etc. Some of the key
user scenarios are as follows:
Log into the application,
browse the shopping cart details and log out of the application.
Log into the application,
purchase items from the shopping cart and log out of the application.
Log into the application,
search for required items and log out of the application.
Step 3: Identify Load
- Identify whether you need to place a constant number
of virtual users for the duration of the test (load testing) to determine
the minimum configuration under which the web application can perform
satisfactorily. or
- Follow an approach to ramp up the test and then ramp
down (peak testing) - say you ramp up to 100 users and remain in the peak
state for 20 seconds, and then drop the number of users to ramp down at
every 20 seconds. This will help you to find the maximum performance limit
of your web application. or
- Choose the load type where you run the load test
over long periods of time with normal user loads and exit the test when
the specified criteria is met. This will help you to assess the web application's
stability over long periods of time.
For each user scenario, identify the following:
- Number of users
- The total number of users accessing your web application over
a given time frame.
- Percentage of users
- Identify the percentage of users accessing parts of your web application
or the users to be associated with each user scenario such as 60% of users
browsing the home page, 20% of users purchasing items from the shopping
cart and the other 20% of users searching for required items, etc.
Step 4: Identify Metrics
Identify the relevant metrics that you need to collect in your load
test. This will help you easily analyze the potential bottlenecks in your
web application in relation to your performance objectives. Metrics collected
can include CPU usage, memory usage, hits per second, server response
time, page download time, error percentage, etc.
Following are the performance metrics that can be monitored:
System-specific metrics: This set of metrics helps you to measure
the resource utilization in your web server. The system resources such
as total % of CPU usage and memory usage of the configured system can
be measured.
Web application-specific metrics: This set of metrics helps
you to measure the server response time (time between Request sent to
time of receiving First Byte), page download time, page response time,
errors in web pages, throughput (which measures the data transferred relative
to some unit of time), etc. You can also measure the overall application
throughput, hits per second, response time, page download time and time
taken to complete each transaction.
Database-specific metrics: This set of metrics helps you to measure
the database issues. Metrics collected for MySQL include thread details,
connection details, query details, table-related statistics, etc.
Once you identify the above,
create the load test and run the test for multiple iterations, analyze
the results, use the results to improve both the subsequent testing and/or
tune the system resources or your web application being tested, and run
the load test again.