Date post: | 09-May-2015 |
Category: |
Software |
Upload: | rachappa-bandi |
View: | 309 times |
Download: | 8 times |
Performance Testing Using Jmeter
- By Rachappa Bandi
Testing to determine how a system performs in terms of responsiveness and stability under the given workload.
It can also serve to investigate scalability, reliability and resource usage.
What is Performance Testing
To demonstrate that the system meets performance criteria. To compare two systems to find which performs better. To measure what parts of the system or workload causes the
system to perform badly.
Speed - Does the application respond quickly enough for the intended users?
Scalability – Will the application handle the expected user load and beyond? (AKA Capacity)
Stability – Is the application stable under expected and unexpected user loads? (AKA Robustness)
Confidence – Are you sure that users will have a positive experience on go-live day?
Why we do performance testing
Performance Testing Load Testing Stress Testing Capacity Testing Endurance Testing Spike Testing
Performance Test Types
Load Testing behavior of the system under a specific
expected load Concurrency Speed/Throughput
Stress Testing the upper limits of capacity within the system
Scalability/Stability
Performance Test Types
• Benchmark testing Compare competitive product Check performance with previous builds
Performance Test Types
Response time User concerns
Throughput Business concerns
Resource utilizations System concerns
What we measure
Project assessment Goals/Scoping: “What do you want to achieve?”
Methodology/Planning “How do you plan to achieve it?”
Implementation/Execution “Doing what you planned”
Validation/Evaluation “Did you achieve your goals?”
Results/Interpretation “What does the output of the testing mean?”
Phases of Performance Testing
Performance Test Cycle
Tools
Free/Open source tools JMeter
Commercial tools Load Runner Webload
Other useful tools Httpwatch YSlow
Introduction to JMeter
What is JMeter
Performance testing tool (like LoadRunner, WebLoad, OpenSTA , etc)
It supports performance testing of:
Web application Web services (SOAP and REST) Database query performance Mail - SMTP(S), POP3(S) and IMAP(S) JMS Mobile
Apache Project - http://jmeter.apache.org/
100% pure Java desktop application
Originally developed by Stefano Mazzocchi
Features of JMeter
• Load and performance test various protocols - HTTP(S), FTP, JDBC, JMS, LDAP, SOAP
•HTTP proxy server for recording test scripts
•Platform Independent
•Execution can do in batch mode and analyze offline.
•Distributed testing.
•Extensible. – Plugins (https://code.google.com/p/jmeter-plugins/)
Test Architecture
Strengths
• Free and open source
• Active development/ community
• Extensibility
• Capability of dynamic scripting/ generate load/ and reporting
• Supports automation (Maven with Jenkins CI for performance testing in regression mode)
• Cloud compatibility
Weaknesses
• Memory management issuesBut …adjust Heap memory/ use 64-bit version/ run non-GUI
mode
• Reports are a bit lackingBut... Plugins provides many
• Steep learning curveLack of Training opportunities and require technical skills
• Limited Support No dedicated support like commercial tools
• The latest version of JMeter can be downloaded from the project website: http://jmeter.apache.org/download_jmeter.cgi
• JMeter requires a fully compliant JVM 1.6 or higher.You need Java, with the JAVA_HOME environment variable set.
• To install a release build, simply unzip the zip/tar file into the directory where you want JMeter to be installed.
• To run JMeter, run the jmeter.bat (for Windows)• or jmeter.sh (for Unix) file.
Setting Up and Running JMeter
• Test Plan: where the overall settings for a test are specified.
• Thread groups: defines a pool of users that will execute a particular test case against your server.
• Samplers: sends requests to a server• Logical controllers : control flow of test plan (loops, conditionals, ordering,
etc.)• Listeners: record, summarize and display record and response data• Timers: introduce delays in test plan• Assertions: assert facts about responses, for functional testing• Configuration elements: Configuration Elements set default values for other
parts of the Test Plan as well as configure variables.• Pre-processors and post-processors
• Workbench :It provides a place to temporarily store test elements while not in use for copy/paste purposes • JMeter Proxy Server : watch and record your actions while you browse your
web application with your normal browser
JMeter Elements
Demo