Performance Testing Fundamentals
Performance Testing Fundamentals
Revision 1.0
March, 2017
This document is Confidential and Proprietary to SPM Software, Inc. No part of this
document may be reproduced or used in any form or by any means, graphic, electronic,
or mechanical, including photocopying, recording, taping, or information storage and
retrieval systems without written permission from SPM Software, Inc.
Contents
1. Overview ........................................................................................................................... 1
1.1 What is Performance? The End-User Perspective ................................................. 1
1.2 Performance Measurement....................................................................................... 1
1.3 Performance testing ................................................................................................... 2
1.3.1 Load testing ...................................................................................................................... 2
1.3.2 Stress testing ..................................................................................................................... 3
1.3.3 Endurance testing ............................................................................................................ 3
1.3.4 Spike testing ...................................................................................................................... 3
1.4 Performance versus Scalability ................................................................................ 3
1.5 QA Testing versus Performance Testing ................................................................ 3
2. Performance Testing Core activities ............................................................................ 5
2.1 Summary Table of Core Performance-Testing Activities ..................................... 5
2.2 Performance-Testing Activities Walkthrough ....................................................... 7
2.2.1 Identify the Test Environment ....................................................................................... 7
2.2.2 Identify Performance Acceptance Criteria ................................................................... 9
2.2.3 Plan and Design Tests ..................................................................................................... 9
2.2.4 Configure the Test Environment ................................................................................. 11
2.2.5 Implement the Test Design ........................................................................................... 12
2.2.6 Execute the Test .............................................................................................................. 13
2.2.7 Analyze Results, Report, and Retest ........................................................................... 14
3. Load generation ............................................................................................................. 17
3.1 Creating a script for load generation of a web application ................................ 17
3.1.1 Load generation of a simple HTML page ................................................................... 17
3.1.2 Load generation of content dependent pages. ........................................................... 19
3.1.2.1 Parameterize the script .............................................................................................................19
3.1.2.2 Sessions and capture server responses. .....................................................................................19
3.1.2.3 Checking for real results ...........................................................................................................20
3.1.3 Load generation ............................................................................................................. 21
3.1.3.1 The concurrent/active users enigma .........................................................................................21
3.1.3.2 The ramp up .............................................................................................................................22
3.1.3.3 Duration....................................................................................................................................22
4. Monitoring ...................................................................................................................... 23
4.1 System resources ...................................................................................................... 23
4.2 Software components and infrastructure ............................................................. 23
4.3 Correlation and logging .......................................................................................... 24
4.4 Prepare for analysis before the test run ................................................................ 24
5. What to test ..................................................................................................................... 26
5.1 Introduction .............................................................................................................. 26
5.2 Work together with the functional test team ....................................................... 26
5.3 Risk based selection for performance tests........................................................... 26
5.3.1 Risks for the organization ............................................................................................. 26
5.3.2 Risk or chance of a problem ......................................................................................... 27
5.3.3 Combined risk ................................................................................................................ 27
5.4 Making and details of test cases............................................................................. 27
6. GLOSARY ....................................................................................................................... 29
Revision 1.0
1. OVERVIEW
We have become used to having many services available to us provided by computer
systems. Many services are available today on Internet. We have gotten used to buying
items on the Internet, that our email is always accessible, that we can read the news online
when we want to or even see videos of just about anything on Youtube. For the service
providers, the companies that make and operate these web-sites, it is important that you
are pleased with these sites. For you to be pleased, the site needs to do what it promises
properly and attractively. If a site promises to sell books, it should just do that: allow you
to buy books by using their site, it should do it such a way that it is easy for you to use it.
But it should also do it exactly when you want to use and not frustrate you with slow
appearing pages or even time-out errors. In other words, the pages should load quickly.
When the service provided has a lot of competition the pages should load quickly: a study
commissioned by Forester consulting for Akamai showed that 40% of users will leave a
web site if it does not load in two seconds or less, or even worse: they often try out
competition.
The performance is important not just on the Internet: corporate applications performing
fast will benefit the corporation as well, the employees may not have the benefit of turning
to a competitor or alternative tools, but they can become more efficient, saving on labor
costs.
Well performing application save money, not just on the sheer seconds saved but also on
the increased productivity due to less frustration with the tools at the employees.
Performance-testing success
criteria
Client expectations
Performance goals and
Identify Risks to be mitigated
requirements
Performance Business requirements
Key areas of investigation
Acceptance Criteria Contractual obligations
Key performance indicators
Key business indicators
Available application
Conceptual strategy
features and/or
Plan and Design Test execution prerequisites
components
Tests Tools and resources
Application usage
required
scenarios
Configured load-generation
Conceptual strategy and resource-monitoring
Configure the Test Available tools tools
Environment Designed tests Environment ready for
performance testing
Conceptual strategy
Available
Validated, executable tests
tools/environment
Validated resource
Implement the Test Available application
monitoring
Design features and/or
Validated data collection
components
Designed tests
Hardware
o Configurations
o Machine hardware (processor, RAM, etc.)
Network
o Network architecture and end-user location
o Load-balancing implications
o Cluster and Domain Name System (DNS) configurations
Tools
o Load-generation tool limitations
o Environmental impact of monitoring tools
Software
o Other software installed or running in shared or virtual environments
o Software license constraints or differences
o Storage capacity and seed data volume
o Logging levels
External factors
o Volume and type of additional traffic on the network
o Scheduled or batch processes, updates, or backups
o Interactions with other systems
Consider the following key points when characterizing the test environment:
Response time. For example, the product catalog must be displayed in less than
three seconds.
Throughput. For example, the system must support 25 book orders per second.
Resource utilization. For example, processor utilization is not more than 75
percent. Other important resources that need to be considered for setting objectives
are memory, disk input/output (I/O), and network I/O.
Business requirements
User expectations
Contractual obligations
Regulatory compliance criteria and industry standards
Service Level Agreements (SLAs)
Resource utilization targets
Various and diverse, realistic workload models
The entire range of anticipated load conditions
Conditions of system stress
Entire scenarios and component activities
Key performance indicators
Previous releases of the application
Competitors applications
Optimization objectives
Safety factors, room for growth, and scalability
Schedule, staffing, budget, resources, and other priorities
When identified, captured, and reported correctly, metrics provide information about how
your applications performance compares to your desired performance characteristics. In
addition, metrics can help you identify problem areas and bottlenecks within your
application.
It is useful to identify the metrics related to the performance acceptance criteria during test
design so that the method of collecting those metrics can be integrated into the tests when
implementing the test design. When identifying metrics, use either specific desired
characteristics or indicators that are directly or indirectly related to those characteristics.
Consider the following key points when planning and designing tests:
Realistic test designs are sensitive to dependencies outside the control of the system,
such as humans, network activity, and other systems interacting with the
application.
Realistic test designs are based on what you expect to find in real-world use, not
theories or projections.
Realistic test designs produce more credible results and thus enhance the value of
performance testing.
Component-level performance tests are integral parts of realistic testing.
Realistic test designs can be more costly and time-consuming to implement, but they
provide far more accuracy for the business and stakeholders.
Extrapolating performance results from unrealistic tests can create damaging
inaccuracies as the system scope increases, and frequently lead to poor decisions.
Involve the developers and administrators in the process of determining which
metrics are likely to add value and which method best integrates the capturing of
those metrics into the test.
Beware of allowing your tools to influence your test design. Better tests almost
always result from designing tests on the assumption that they can be executed and
then adapting the test or the tool when that assumption is proven false, rather than
Realistic simulations of user delays and think times, which are crucial to the
accuracy of the test.
User abandonment, if users are likely to abandon a task for any reason.
Common user errors.
Consider the following key points when configuring the test environment:
Determine how much load you can generate before the load generators reach a
bottleneck. Typically, load generators encounter bottlenecks first in memory and
then in the processor.
Although it may seem like a common sense practice, it is important to verify that
system clocks are synchronized on all the machines from which resource data will
be collected. Doing so can save you significant time and prevent you from having
to dispose of the data entirely and repeat the tests after synchronizing the system
clocks.
Validate the accuracy of load test execution against hardware components such as
switches and network cards. For example, ensure the correct full-duplex mode
operation and correct emulation of user latency and bandwidth.
Validate the accuracy of load test execution related to server clusters in load-
balanced configuration. Consider using load-testing techniques to avoid affinity of
clients to servers due to their using the same IP address. Most load-generation tools
offer the ability to simulate usage of different IP addresses across load-test
generators.
Consider the following key points when implementing the test design:
Ensure that test data feeds are implemented correctly. Test data feeds are data
repositories in the form of databases, text files, in-memory variables, or
spreadsheets that are used to simulate parameter replacement during a load test.
For example, even if the application database test repository contains the full
production set, your load test might only need to simulate a subset of products
being bought by users due to a scenario involving, for example, a new product or
marketing campaign. Test data feeds may be a subset of production data
repositories.
Ensure that application data feeds are implemented correctly in the database and
other application components. Application data feeds are data repositories, such as
product or order databases, that are consumed by the application being tested. The
key user scenarios, run by the load test scripts may consume a subset of this data.
Ensure that validation of transactions is implemented correctly. Many transactions
are reported successful by the Web server, but they fail to complete correctly.
Examples of validation are, database entries inserted with correct number of rows,
product information being returned, correct content returned in html data to the
clients etc.
Ensure hidden fields or other special data are handled correctly. This refers to data
returned by Web server that needs to be resubmitted in subsequent request, like
session IDs or product ID that needs to be incremented before passing it to the next
request.
Validate the monitoring of key performance indicators (KPIs).
Add pertinent indicators to facilitate articulating business performance.
If the request accepts parameters, ensure that the parameter data is populated
properly with variables and/or unique data to avoid any server-side caching.
As you prepare to begin test execution, it is worth taking the time to double-check the
following items:
Validate that the test environment matches the configuration that you were
expecting and/or designed your test for.
Ensure that both the test and the test environment are correctly configured for
metrics collection.
Before running the real test, execute a quick smoke test to make sure that the test
script and remote performance counters are working correctly. In the context of
performance testing, a smoke test is designed to determine if your application can
successfully perform all of its operations under a normal load condition for a short
time.
Reset the system (unless your scenario calls for doing otherwise) and start a formal
test execution.
Make sure that the test scripts execution represents the workload model you want
to simulate.
Validate test executions for data updates, such as orders in the database that have
been completed.
Validate if the load-test script is using the correct data values, such as product and
order identifiers, in order to realistically simulate the business scenario.
Whenever possible, limit test execution cycles to one to two days each. Review and
reprioritize after each cycle.
If at all possible, execute every test three times. Note that the results of first-time
tests can be affected by loading Dynamic-Link Libraries (DLLs), populating server-
side caches, or initializing scripts and other resources required by the code under
test. If the results of the second and third iterations are not highly similar, execute
the test again. Try to determine what factors account for the difference.
Observe your test during execution and pay close attention to any behavior you feel
is unusual. Your instincts are usually right, or at least valuable indicators.
No matter how far in advance a test is scheduled, give the team 30-minute and 5-
minute warnings before launching the test (or starting the days testing) if you are
using a shared test environment. Additionally, inform the team whenever you are
not going to be executing for more than one hour in succession so that you do not
impede the completion of their tasks.
Do not process data, write reports, or draw diagrams on your load-generating
machine while generating a load, because this can skew the results of your test.
Turn off any active virus-scanning on load-generating machines during testing to
minimize the likelihood of unintentionally skewing the results of your test.
While load is being generated, access the system manually from a machine outside
of the load-generation environment during test execution so that you can compare
your observations with the results data at a later time.
Remember to simulate ramp-up and cool-down periods appropriately.
Do not throw away the first iteration because of application script compilation, Web
server cache building, or other similar reasons. Instead, measure this iteration
separately so that you will know what the first user after a system-wide reboot can
expect.
Test execution is never really finished, but eventually you will reach a point of
diminishing returns on a particular test. When you stop obtaining valuable
information, move on to other tests.
If you feel you are not making progress in understanding an observed issue, it may
be more efficient to eliminate one or more variables or potential causes and then run
the test again.
Technical Reports
o Description of the test, including workload model and test environment.
o Easily digestible data with minimal pre-processing.
o Access to the complete data set and test conditions.
o Short statements of observations, concerns, questions, and requests for
collaboration.
Stakeholder Reports
o Criteria to which the results relate.
o Intuitive, visual representations of the most relevant data.
o Brief verbal summaries of the chart or graph in terms of criteria.
o Intuitive, visual representations of the workload model and test
environment.
o Access to associated technical reports, complete data sets, and test
conditions.
The key to effective reporting is to present information of interest to the intended audience
in a manner that is quick, simple, and intuitive. The following are some underlying
principles for achieving effective reports:
The browser uses that and shows it to the user like this:
Now if the page would have a graphic in there such as company logo, that graphic would
not have been in the actual HTML file. The HTML file would tell the browser that it should
also show the graphic and where to find it. So right after receiving the HTML file, the
browser would put out another request for.
What happens within the communication between the web browser and the server is that
the browser requests pages and other items, and the server responds with these pages and
other items. The browser will use the responses to render the pages on the screen for the
user. An HTML page, such as returned to the browser by the server, is really a text file
which tells the browser how to render the page. In it you will nearly always also see that is
should depict a graphic such as a picture. The browser will also request these graphics to
the server. A simple HTML page with a logo will mean a request for the page by the
browser, a response containing the page by the server, another request by the browser for
the logo graphic and the response by the server containing the graphic.
When we record this in a load generation tool, the tool will listen on this communication
between the browser and the server and will record it. When we stop the recording, we can
use the tool to replay the requests. What really happens at the replay is that the tool sends
the same request as during the recording. The big difference here is that the page will not
be rendered. It doesnt have to be, as we are interested in the effect on the server.
Now this needs to be turned into load. If we want to simulate for instance 10 users, the load
generator now simply will request the same page as well as the graphic that belongs to it
10 times at the same time. So, it will send simultaneously 10 requests for the HTML file.
And then, it will also send 10 requests for the graphic file. The timing between these
requests is important. To really emulate 10 virtual users the requests for the graphic file
needs to emulate what would happen if 10 real users were to request the page. So, the
graphic file not only needs to be requested after the HTML file was received, but also the
time it took the browser to request the file after it had received the HTML file during
recording.
This also explains why the load generator must be aware of not just the ability of HTTP. It
also needs to know how browsers work. It needs to consider that the browser would never
request the graphic files before it had processed the HTML file. And would there have been
3.1.3.3 Duration
How long should your scenario run? Most often you will simply let the scenario run until
the number of virtual users you defined are finished. There are however situations, such as
looking for memory leaks, where you would want a certain load to remain on the system
for a prolonged time. In such cases you need to set the duration for that time. Of course, in
tests where test data can be used only once, there should be more than enough test data in
the files to support such a long time.
Performance measure how fast and efficiently a software system can complete
certain computing tasks. Scalability measure the trend of performance with
increase load. Performance and scalability are inseparable from each other. It
doesnt make sense to talk about scalability if a system does not perform. However,
a system may perform but not scale.
Response time it can be defined as the amount of time it takes for the application to
respond to a user request. In performance testing this is the time between the end
user requesting a response from the application and a complete reply arriving at the
users workstation. This response can be synchronous (blocking) or asynchronous
(user doesnt have to wait for reply to complete before they can resume interaction
with application).
Throughput the rate at which application-oriented events occur. i.e. the number of
hits on a web page within a given period.
Utilization the percentage of the theoretical capacity of a resource that is being
used. i.e.: how much CPU is being consumed by application on a web server when
1,000 visitors are active.
Think time measures the time duration spent by a user on preparing input and
digesting the content of the response until initiating the next action to the system,
whereas response time measures the time spent by the system processing the user
request.
https://www.websitemagazine.com/blog/5-reasons-visitors-leave-your-website
https://blog.kissmetrics.com/loading-time/
http://www.hobo-web.co.uk/your-website-design-should-load-in-4-seconds/