Professional Documents
Culture Documents
Testing:Performance/Load/Stress
Performance Testing usage) Demonstrates that the system meets performance criteria. How fast an application perform under particular work load. Validation,verification of quality attributes (scalability, reliability, resource
Load Testing Modeling the expected usage by simulating multiple users accessing the web
Stress Testing Determination of stability of an application Tries to break the application by overwhelming its resources
Before Starting
What is our estimated number of users (normal load)? What is our anticipated peak number of users? When is a good time to load-test our application(i.e. Off-hours or weekends) keeping
in mind that this may very well crash one or more of our servers?
What is the testing intended to achieve? Sequential Functional (low volume)
Introduction
Definition JMeter is an Apache Jakarta project that can be used as a load testing tool for analysing and measuring the performance of a variety of services, with a focus on web applications Why JMeter JMeter can be used as a unit test tool for JDBC database connection, FTP, LDAP, WebServices, JMS, HTTP and generic TCP connections. JMeter can also be configured
Introduction - Features
100% pure Java Open Source Desktop application Designed for performance/functional/load/stress testing Extensible- write your own tests
- JMeter is a 100% Java application and should runs correctly on any machine
with complaint Java implementation - Tested and works under Unix (Solaris, Linux, etc) Windows (98, NT, XP, etc) Open VMS alpha 7.3+
Unpack the zip or tar.gz in any directory Go to the Jakarta-JMeter directory (directory in which the zip or tar.gz file is unpacked)
Type ./bin/jmeter on command prompt (for Unix) or Run jmeter.bat (for windows) JMeter is ready to test application
10
-R [list of remote servers] Run the test in the specified remote servers
The script also lets you specify the optional firewall/proxy server information: -H [proxy server hostname or ip address] -P [proxy server port] Example : jmeter -n -t my_test.jmx -l log.jtl -H my.proxy.server -P 8000
11
Elements of Testplan
Thread Group - The beginning points of any test plan Allows to Set the number of threads
Logic Controllers
Let you customize the logic that JMeter uses to decide when to send requests
Samplers - Tell JMeter to send requests to a server and wait for a response
12
Pre-processor elements
Executes some action prior to a Sampler Request being made most often used to modify the settings of a Sample Request just before it runs
Post-processor elements executes some action after a Sampler Request has been made most often used to process the response data, often to extract values from it
13
Listeners
Assertions Allow you to assert facts about responses received from the server being tested
14
Elements of Testplan
Thread Group
Logic Controller
Configuration Element
Sampler s
15
Execution Order
Timers Preprocessors Samplers
Post-processors
Assertions Listeners
16
17
18
19
OR
Press Ctrl+R
20
21
22
Life-cycle
Plan Test
Analyze Results
Test Plan
Sampler s Timers
Listeners
23
Analyzing Results
JMeter supports this step by: displaying the data visually (Graph Results) save data in file
24
Advantages
It is free Easy to install and use Compared to other load and performance testing tools, it is not only for web
25
Demo
26
27
28
29
30
31
32
Tips
Use timers to avoid hammering the server Limit the Number of Threads
- Hardware will limit the number of threads you can effectively run. A faster machine makes JMeter work harder since it returns request quicker. User variables
- Create a text file containing the user names and passwords. - Add a CSV DataSet configuration element. Name the variables USER and PASS. Use ${USER} and ${PASS} within samplers. Reducing resource requirements
- Use non-GUI mode. - Use as few Listeners as possible. - Reduce samplers by looping (by thread and by controller), and use variables (CSV Data Set) to vary the sample. - Use CSV output rather than XML.
33
Thank You !