Performance Testing For Web Applications: White Paper
Performance Testing For Web Applications: White Paper
Performance Testing
for Web Applications
Table of Contents page
But for an online business to be successful it has to be available at a click of a button—without long wait
times, delays, errors, or service interruptions.
Websites must be able to handle sudden increases in traffic or operation volume without compromising
the user experience or a company’s ability to quickly and accurately process business transactions.
In this paper, we will discuss the importance of measuring application performance, and explore best
practices for load and performance testing. We will also examine various components of a successful
performance testing process as well as look at the attributes of a reliable performance testing software
solution. With that, we’ll provide an overview of Micro Focus® LoadRunner software, the industry-leading
performance validation tool.
But the more companies rely on Web applications for running their business and generating revenue,
the greater the risk of failure due to the complexity behind the Internet. At the early age of online com-
merce, most companies didn’t invest any time in pre-production performance testing, or at the very best
www.microfocus.com 1
White Paper
Performance Testing for Web Applications
performed manual testing—hoping that their infrastructure would support the user load after the applica-
tion went live. Not surprisingly, it was common to see a website go down right after go live, a big upgrade, Today’s businesses can’t
afford even short-term
or following a promotional campaign and a subsequent increase in traffic. But today’s businesses can’t
interruptions, and the
afford even short-term interruptions, and the new generation of online-savvy consumers expects reliable new generation of online-
service and timely response at all times. If a site cannot accept an order or is taking too long to display savvy consumers expects
product selection, customers won’t hesitate to take their business elsewhere. Tough competition and reliable service and timely
uncertain economic climate demand that companies pay closer attention to quality, reliability, availability, response at all times.
and performance of their online applications.
Today’s Web applications are also more complex than ever before. Scaling a multifaceted, integrated in-
frastructure from end to end means managing the performance and capacities of individual components
within each tier—as well as measuring the overall transaction response times of the entire system.
This complexity triggers many uncertainties about the integrity and performance capabilities of a Web
application. Will it provide consistently fast response times for all users—regardless of where they are
coming from or what type of connection they are using? Can an application sustain a large user volume?
Will it remain fast and reliable after a sudden increase in the number of users? Is there sufficient hardware
on each tier to handle high traffic volumes? Can all the interoperable pieces of the system work reliably
together? What is the maximum capacity of the application? To answer these questions, you must be
able to predict how your Web applications will behave in a production environ¬ment before going live, and
continue to measure and monitor your system throughout its lifecycle.
Figure 2. The VuGen allows you to emulate production workloads on an entire system
2
The only way to accurately Put Your Apps through the Paces
predict system behavior
is to execute performance A typical response to growing traffic on your website is to add more hardware to each component of the
testing in your applications system. However, such random attempts to improve performance often lead to overbuying hardware—and
end to end, measure
not necessarily to better performance and scalability since many times the application was not designed
response times from the
end-user perspective, to be elastic. The only way to accurately predict system behavior is to execute performance testing in
and diagnose and remedy your applications end to end, measure response times from the end-user perspective, and diagnose and
any performance issues remedy any performance issues prior to going live.
prior to going live.
Application performance testing is the way to measure your Web application’s ability to conduct multiple
transactions simultaneously while maintaining adequate response times.It also helps you isolate bottle-
necks in any component of the network infrastructure to accurately pinpoint potential problems.Two
Application performance common approaches to performance testing methods are manual and automated testing.Unfortunately,
testing is the way to
manual testing has several inherent challenges, such as:
measure your Web
application’s ability ■■ Difficulty emulating the behavior of thousands of concurrent users
to conduct multiple
■■ Coordinating user operations
transactions simultaneously
while maintaining adequate ■■ Accurately measuring response times
response times. It also helps ■■ Comparing results between test runs, scenarios, and iterations
you isolate bottlenecks
in any component of the Manual testing is also not the most practical option because in order to accurately diagnose problems, you
network infrastructure must repeat tests multiple times: first to identify performance problems, tune the system, and then retest
to accurately pinpoint to verify that tuning has had a positive impact. Manual testing is an option for business failure.
potential problems.
With automated performance testing tools, you can automatically run tests and measure results. You can
also easily and cost-effectively create and maintain scripts and scenarios to maximize reuse between test
runs and accurately compare results. Automated testing tools help reduce the risk of human error during
testing. As a result, automated performance testing has become the preferred choice for companies of
all types and sizes for performance testing of their business critical applications. Automated testing tools
typically use three major components to execute a test:
■■ A control console that organizes, drives, and manages the load and use behavior
■■ Virtual users (Vusers)—processes used to imitate a real user performing a business process on a
client application
■■ Load servers (used to run the Vusers)
www.microfocus.com 3
White Paper
Performance Testing for Web Applications
This advanced functionality definitely allows you to save time and resources.
The primary goal of
Accuracy Scalability and Capacity Management load testing tools is to
Record load testing scripts against a real client application Generate more Vusers that can be run on a single machine accurately predict system
before exceeding it capacity performance and isolate
Capture protocol-level communication between Generate more hits per second against a Web server performance issues.
the client application and the rest of the system
Provide flexibility and the ability to define configurations Manage thousands of Vusers
for user behavior (for example, think times, connection
speeds, cache settings, iterations)
Verify that the requested content returns to the browser to Increase the number of Vusers in a controlled manner
facilitate a successful transaction With a disciplined approach
Show detailed performance results that can be easily Simulate the effect of scaling out to remote locations over to performance testing, you
understood and analyzed to identify the source of wireless area networks (WANS) can optimize resources,
the problem
better predict hardware,
Measure end-to-end response times
software, and network
Use real-life data
requirements, and set
Synchronize Vusers to generate peak loads
Monitor different tiers of the system with less intrusion
performance expectations
to meet customer service
Table 1. Accuracy and Scalability are key attributes of an automated performance testing solution. level agreements (SLAs).
4
IDENTIFY YOUR KEY PERFORMANCE GOALS
Stress testing is the way These may include determining which processes and transactions to test, which system components to
to validate an application’s
use in the test, and the number of concurrent connections and hits per second to expect against the ap-
stability and reliability by
plication. You also want to look at the overall end-to-end business processes to clarify which ones need
applying a load for an
extended period of time. to be tested.
For example, an online book retailer may flag the “buy book” transaction for the purposes of a test. The
overall transaction can include browsing the book selection, choosing a book to purchase, enter¬ing
payment and shipping information, and completing the purchase. By clearly defining the load testing
objectives, you can provide a concise outline of the SLAs and mark the goals to be achieved with testing.
■■ Determining which servers are configured into the system (Web, application, and database)
You must also know which resources are available to run the Vusers by deciding whether you have suf-
ficient numbers of load generators or test machines to run the appropriate number of Vusers. You must
also determine whether the testing tool has multi- threading capabilities and can increase the number of
Vusers being run. Ultimately, your goal is to reduce your consumption of system resources while increas-
ing the number of Vusers.
www.microfocus.com 5
White Paper
Performance Testing for Web Applications
must identify and record all the various business processes from start to finish. This can help you determine
the amount of time you need to measure the performance of a business process. Run-time settings define
the way the script runs in
order to accurately emulate
CREATING VIRTUAL USER SCRIPT WITH LOADRUNNER
real users. Settings can
To create a Vuser script, you can record a business processes with LoadRunner Virtual User Generator configure think times,
(VuGen). VuGen is a component that runs on a client desktop to capture the communication between connection speeds, and
the client application and the server. VuGen can emulate the exact behavior of a real browser by sending error handling rules. Think
various protocol requests to the server. times can vary depending on
your customer’s actions and
complexity of a transaction.
LoadRunner’s TruClient technology is an innovative, browser-based virtual user generator (VuGen) that
supports simple Web as well as modern JavaScript-based applications. The scripting engine is embedded
within the browser, and behaves like a true browser client. It utilizes a unique, patented approach to object
recognition, which makes it an extremely flexible and extensible solution for testing Web 2.0 applications.
Once the script has been generated, you can add logic and intelligence to make it more realistic imitating
a real user interacting with an application. Logic can be added at the transaction level, as well as using
verification and parameterization techniques.
■■ Transactions: Transactions represent a series of operations that must be measured under load
conditions.A transaction can be a single operation by a customer or a complete business process
leading through several screens, such as the end-to-end process of selecting, comparing,
and purchasing a product online.
■■ Verification: VuGen allows you to insert verification checkpoints using ContentCheck, which verifies
that the application functions as expected by analyzing the returned page. If the verification fails,
LoadRunner can log the error and highlight the reasons for the failure (for example, broken link,
missing images, erroneous text, and so on).
Your system’s response times will also vary depending on the users’ connection speed. WAN emulation ac-
curately imitates a variety of connection options at varying network bandwidth and latencies. This can help
you determine how the underlying network affects application response times. Because errors can arise
throughout a scenario and impede testing, you also need to configure error handling. You can configure
Vusers to handle these errors so you can run the tests uninterrupted. Network communications errors can
also profoundly influence application response times. You can also configure WAN emulation to introduce
underlying network errors to understand their impact and measure the application’s tolerance for them.
6
20
10
Number of users
Figure 3. This generic graph shows application performance under load. In this example, the application response
times increase sharply once the number of concurrent users reaches 7,500
120
Number of transactions
100
80
60
40
20
0
1 2 3 4 5 6
Business Transaction
Pass
Fail
Figure 4. This generic graph shows transactions that passed or failed. In this example, transaction number two
failed approximately one-third of the time. Depending on how critical this transaction is, such high failure rate is likely
not acceptable for the business
www.microfocus.com 7
White Paper
Performance Testing for Web Applications
■■ Emulate cache: Emulates a user browsing with a specific cache size. Caching can be turned off
based on server requirements.
To accurately simulate
■■ Browser emulation: Enables you to specify which browser the Vuser simulates. real-user behavior, Vusers
use varying sets of data
■■ Number of connections: Allows the Vuser to control the number of connections to a server.
during load testing that
■■ IP spoofing: Tests the performance impact of IP-dependent components by assigning Vusers their replace constant values in
own IP addresses from the same physical machine. the script with variables or
parameters. The Vuser can
■■ Iterations: Commands repetition of Vuser scripts and paces Vusers, instructing how long to wait
substitute the parameters
between intervals. Iterative testing defines the amount of work a user does based on the number of with values from a data
times a process is performed using varying data. source, such as flat files,
■■ Error handling: Regulates how a Vuser handles errors during script execution. LoadRunner can random numbers, date/time,
and so on. This allows you
enable the continue on error feature when the Vuser encounters an error during replay.
to test a business process
■■ Log files: Stores information about a Vuser’s server communication. Standard logging maps all with varied sets of data.
transactions, rendezvous, and output messages. Extended logging also tracks warnings and
other messages.
1. 2. 3. 4.
The Controller is a Hundreds of virtual Real-time monitors Results are storedin
central console users perform capture performance a database allowing
from which the load real-life transactions data across all tiers, users to generate
tests are managed to simulate servers and network reports and perform
and monitored. production traffic. resources and analysis.
display information
on the Controller.
Figure 5. How LoadRunner Works
8
Step 4: Defining the Performance Tests Scenarios
After Vuser groups have The performance test scenario contains information about the groups of Vusers that can run the scripts
been assigned, you must
determine which load- and the load machines on which the groups are running. To run a successful scenario, you must first cat-
generating machines the egorize your customers into groups based on their transactions. Then, you need to define and distribute
Vusers can run on. You the total number of Vusers. You can assign a varying number of Vusers to individual business processes
can add load generator
to emulate user groups performing multiple transactions. One group may be searching for a book, while
machines to the client side
of the system architecture the second and third groups are entering payment information or shipping addresses. After Vuser groups
to run additional Vusers. have been assigned, you must determine which load-generating machines the Vusers can run on. You
can add load generator machines to the client side of the system architecture to run additional Vusers.
Finally, you need to specify how the scenario will run. You can run the Vuser groups either in staggered
or parallel formation. Staggering the Vusers allows you to examine a gradual increase of the user load
to a peak.
In addition, LoadRunner offers a scenario wizard and a scheduler to enhance your experience during test-
ing. The LoadRunner scenario wizard allows you to quickly compose multiuser load test scenarios. Using
five easy-to-follow screens, the scenario wizard leads you through a process of selecting the workstations
that can host the Vusers, as well as the test scripts to run.
During this step-by-step process, you also create simulation groups of Vusers. The LoadRunner scheduler
is used to ramp Vuser numbers up or down in order to position Vusers in both the ready state and the run-
ning state. For example, you may want to gradually increase the number of customers logging onto your
site with a fixed batch size. This is referred to as the ready state. This method helps avoid unnecessary
strain on the system.
www.microfocus.com 9
White Paper
Performance Testing for Web Applications
Figure 6. The VuGen allows you to capture business processes to create Vusers
The scheduler also manages scheduling and features an automated process that allows the user to run
the script without being present. In real time, this would be similar to running a script during off-peak
hours—such as 6 p.m.to 6 a.m. To schedule a test, you simply click the Run Scenario button and enter the
desired starting time.
By staggering the decreases in network bandwidth or increases in latency, errors, and jitter, you can under-
stand their relative influence on application behavior. This data can be used to set network requirements
for the application when it is deployed. You can conduct this kind of testing directly over the network to
remote locations, but for testing purposes it is generally more practical to emulate the network where
you can easily establish a variety of conditions using WAN emulation. This can allow you to predict the
performance for remote users.
10
DEFINING LOAD TESTING PER LOCATIONS WITH LOADRUNNER
Every component of the LoadRunner has the ability to handle WAN emulation, so you can use the same virtual-user scripts used in
system requires monitoring:
the previous steps for network impact tests. Network characteristics such as connection speed, latency,
the clients, the network, the
Web server, the application and error rates are modified for groups of Vusers that are simultaneously emulated during a single test run.
server, the database, and You can then accurately determine the impact of the network on response time on the different groups,
all server hardware. as well as the sensitivities of the application to the network. You can record expected response time data
and network requirement set for use later when the application goes live.
Step 5: Running the Load Test Scenario and Monitor the Performance
During a performance
test, Diagnostics traces You can view the application’s performance at any time during the test using real-time monitoring. Every
business processes from component of the system requires monitoring: the clients, the network, the Web server, the application
the client side across all server, the database, and all server hardware. You can detect performance bottlenecks early during testing
tiers of the infrastructure,
using real-time monitoring. You then have the ability to view the performance of every single tier, server, and
and then breaks down
each transaction response component of the system during testing. As a result, you can instantly identify performance bottlenecks
time into time spent in the during load testing. This can allow you to accelerate the test process and achieve a more stable application.
various tiers and within
individual components. RUN THE LOAD TEST SCENARIO AND MONITOR THE PERFORMANCE WITH LOADRUNNER
Once the scenario is built, you are ready to run the test. The LoadRunner controller provides a suite of
performance monitors that can monitor each component of a multi-tier system during the load test. By
capturing performance data over the entire system, you can correlate this information with the end-user
loads and response times to identify bottlenecks. LoadRunner provides performance monitors for all parts
of the system under test—including Web servers, application servers, databases, ERP and CRM systems,
firewalls, and load balancers. LoadRunner can identify hardware limitations and software configuration
issues that might otherwise go undetected. All performance monitors are non-intrusive and hardware
and OS independent, so they do not require that agents be installed on the remotely monitored servers.
To look deeper into each transaction—from end-user response time all the way down to the application
method level—you can use Diagnostics software. During a performance test, Diagnostics traces business
processes from the client side across all tiers of the infrastructure, and then breaks down each transaction
response time into time spent in the various tiers and within individual components. Diagnostics provides:
■■ An intuitive, easy-to-use view of how individual tiers, components, memory, and SQL statements
impact overall performance of a business process under load conditions
■■ The ability to more easily find components relevant to a specific business process under test
■■ The ability to triage and find problems effectively with business context, enabling teams to focus
on problems impacting business processes
www.microfocus.com 11
White Paper
Performance Testing for Web Applications
Figure 7. LoadRunner and Diagnostics allow you to monitor system performance during tests, diagnose performance
bottlenecks as they occur, and identify root cause of the issues
First, a network specialist (such as a database administrator or consultant) can make the necessary ad-
justments to the system. Then you need to rerun the scripts to verify that the changes have taken place.
Finally, you can measure the amount of improvement the system has undergone by comparing results
from before and after testing.
12
The LoadRunner Analysis component provides a single integration environment that collectively gathers
The LoadRunner Analysis all the data generated throughout the testing cycle. LoadRunner Analysis provides advanced capabilities
component provides
that let you compare results across scenarios and drill down into network layers to identify bottlenecks.
a single integration
environment that collectively In addition, LoadRunner Analysis uses a series of sophisticated graphs and reports that help you answer
gathers all the data such questions as: What was the Web server’s CPU memory when the system was under a load of 5,000
generated throughout the simultaneous users? How many total transactions passed or failed after the completion of the load test?
testing cycle. LoadRunner How many hits per second can the Web server uphold? What were the average transactions times for each
Analysis provides advanced Vuser? Figures 8 and 9 show examples of LoadRunner Analysis graphs. LoadRunner provides a variety of
capabilities that let you
performance graphs, such as the ones listed below:
compare results across
scenarios and drill down ■■ Percentile: analyzes percentage of transactions that were performed within a given time range
into network layers to
■■ Performance under load: indicates transaction times relative to the number of Vusers running
identify bottlenecks.
at any given point during the scenario
■■ Transaction performance: displays the average time taken to perform transactions during each
second of the scenario run
■■ Transaction performance summary: displays the minimum, maximum and average performance
times for all the transactions in the scenario
■■ Transaction performance by Vuser: displays the time taken by an individual Vuser to perform
transactions during the scenario
■■ Transaction distribution: displays the distribution of the time taken to perform a transaction
Figure 8. This sample activity graph displays the number of completed transactions (successful and unsuccessful)
performed during each second of a load test. This graph helps you determine the actual transaction load on your
system at any given moment.
www.microfocus.com 13
White Paper
Performance Testing for Web Applications
Because LoadRunner
is extremely flexible
customers can design
the performance testing
based as their own specific
project requirements.
Figure 9. This graph displays the number of transactions that passed, failed, aborted, or ended with errors.
■■ Pinpoint end-user, system-level, and code-level bottlenecks rapidly and with ease
14
Using minimal hardware resources, LoadRunner emulates hundreds or thousands of concurrent users to
Using minimal hardware apply production workloads to almost any application platform or environment. LoadRunner stresses an
resources, LoadRunner
application from end-to-end—applying consistent, measurable, and repeatable loads— then uses the
emulates hundreds or
thousands of concurrent data to identify scalability issues that can affect real users in production.
users to apply production
workloads to almost As it drives load against the system, LoadRunner captures end-user response times for business
any application platform
or environment. As it drives load against the system, LoadRunner captures end-user response times for business pro-
cesses and transactions. Non-intrusive, real-time performance monitors obtain and display performance
data from every tier, server, and system component. Strong analysis capabilities help isolate performance
bottlenecks quickly and efficiently.
To enable load testing earlier in the application lifecycle, LoadRunner integrates with the leading J2EE,
Microsoft Visual Studio, and Microsoft .NET environments. This integration lets you create LoadRunner
scripts directly within the IDE, so developers can participate in the performance testing efforts earlier.
As part of the lifecycle approach to application testing, LoadRunner is also integrated with Unified Functional
Testing, Application Lifecycle Management, and Application Performance Monitoring (APM) software.
Leveraging these complementary solutions together with LoadRunner provides a comprehensive ap-
proach for managing the overall testing process, measuring release risk, and increasing the reuse of testing
assets from pre-release to production.
www.microfocus.com 15
White Paper
Performance Testing for Web Applications
The intricacy of today’s Web technologies, high traffic volumes, complexity of transactions, and frequent
changes demand that you take a lifecycle approach to performance testing. Make it a part of the delivery The intricacy of today’s Web
technologies, high traffic
process for all applications. By following the best practices and using the right tools for planning, building,
volumes, complexity of
maintaining, and reusing your performance testing assets, you will greatly reduce the risk of failure and transactions, and frequent
enable that your applications remain scalable and reliable throughout the lifecycle. changes demand that you
take a lifecycle approach
to performance testing.
■■ Supports performance testing of new technologies together with your existing, legacy applications
■■ Decreases the risk of deploying systems that do not meet performance requirements
■■ Reduces hardware and software costs by accurately predicting application scalability and capacity
■■ Pinpoints end-user, system-level, and code-level bottlenecks rapidly and with ease
Learn More At
To discover how you can measure application performance using load testing software from Micro Focus,
please visit: www.microfocus.com/loadrunner
16
Additional contact information and office locations:
www.microfocus.com
www.microfocus.com
362-000032-002 | 4AA1-3944 | H | 05/18 | © 2018 Micro Focus or one of its affiliates. Micro Focus and the Micro Focus logo, among others, are
trademarks or registered trademarks of Micro Focus or its subsidiaries or affiliated companies in the United Kingdom, United States and other countries.
All other marks are the property of their respective owners.