Approaching Performance testing

26
PERFORMANCE TESTING @Copyright-Abhijeet Patil([email protected] m)

description

Getting started with performance testing

Transcript of Approaching Performance testing

Page 1: Approaching Performance testing

@Copyright-Abhijeet Patil([email protected])

PERFORMANCE TESTING

Page 2: Approaching Performance testing

@Copyright-Abhijeet Patil([email protected])

1. Typical Scenario2. Performance Testing3. Scope4. Before getting started5. Tool Selection6. Requirement Freezing7. How to design Test cases8. Benchmarking [test data / Hardware]9. Execution [Types of performance test]10. Life Cycle of performance testing11. Jenkins/Results12. Hardware Scaling13. Real World Case Studies

Agenda

Page 3: Approaching Performance testing

@Copyright-Abhijeet Patil([email protected])

www.abc.com

Typical Scenario

Server

Page 4: Approaching Performance testing

@Copyright-Abhijeet Patil([email protected])

Adam : Performance tester John : Adam’s friend

John : “Awesome Adam. That mean we would know the impact on server when there are tons of user accessing our site”

Adam : Exactly you got that right.

Page 5: Approaching Performance testing

@Copyright-Abhijeet Patil([email protected])

John : “So if you say the response time is 3 sec for 100 users that mean when I access the site I will see that page in 3 sec”

Adam : Wait wait wait !!!! Hold on, don’t conclude that so easily. Let understand few more thing before that.

Lets see our next slide

Page 6: Approaching Performance testing

@Copyright-Abhijeet Patil([email protected])

Adam : “John there are following things• Network latency• Server processing time• Browser Rendering

John : “Btw can you give more insight to it”Adam : “Sure. Lets see our next slide ”

Page 7: Approaching Performance testing

@Copyright-Abhijeet Patil([email protected])

Adam : Lets take an example of www.google.com . And understand few basic things

Server

http://www.google.com

GET : www.google.comHttp Request

<html><head>Google</head><body>

Result found…..</body></html>--------------------------------- Http Response--------------------------------

Page 8: Approaching Performance testing

@Copyright-Abhijeet Patil([email protected])

Performance testing

• Traditionally referred to as server side performance testing

• But now a days client side performance testing has also gained importance

• Heavy Java Scripting.• CSS 3 & HTML5 empowering browsers.• Browser getting more and more smarter in rendering

pages and increasing user experience

• Ideally Performance testing = Server Side + Client Side

Page 9: Approaching Performance testing

@Copyright-Abhijeet Patil([email protected])

Scope

• Only serve side performance testing• Journey from the moment GET request is sent till

HTTP Response is received • Network latency + Server processing time

• Will talk mostly about how to approach performance testing activity

• If time permits talk about JMeter

Page 10: Approaching Performance testing

@Copyright-Abhijeet Patil([email protected])

Before getting started

• Know the business cases: This will help you in designing the test scenarios

• The type of application : Web , Web Service • Audience that will be using : LAN , Intranet ,

Internet, Internet but public site• ***Explore your application with some

packet capturing tool. e.g. Fiddler , Parosi.e. Study your application in-depth

Page 11: Approaching Performance testing

@Copyright-Abhijeet Patil([email protected])

Tool Selection

• JMeter (Open Source)• OpenSTA (Open Source)• Load Runner (Commercial)• Silk Performer (Commercial)• VSTS - Web Test (Commercial)• LoadUI (Commercial)• • Many More . . . . . .

Page 12: Approaching Performance testing

@Copyright-Abhijeet Patil([email protected])

John : “So now i have understanding of business scenarios also we decided upon tool. So what’s next”

Adam : “Now most important part of performance test. Capturing the Test Requirements.

It will serve as input to test plan“

Page 13: Approaching Performance testing

@Copyright-Abhijeet Patil([email protected])

• Ask few question to business

• What are the concurrent user(session active) we are expecting our application to handle?

• What are the active user(doing some action) we expect our application should handle?

• What would be the peak load (maximum)on our application ?

• What would be the peak time(s) (timestamp/timestamps) we expect our application will get max load ?

• What would be the response time we are expecting our application should serve ?

• How long we expected our application to work without any failures ?

• And if failure occur what is the acceptable failure rate ?

• How frequently will the web server restart ?

Requirement Gathering

Page 14: Approaching Performance testing

@Copyright-Abhijeet Patil([email protected])

How to design test case

• Identify real world business scenarios, always give priority to them

• Use power of Randomize• Don't forget think time

Lets look at the PMRW script

Page 15: Approaching Performance testing

@Copyright-Abhijeet Patil([email protected])

• Now look for your real time test data. Make it your benchmark

• Best practice is to keep same test data for each execution.

• Automate your pre-requisiteo Write db scripts.

• After execution bring back the system to it previous state. Post-requsiteo Clean up activities

Test-Data Benchmarking

Page 16: Approaching Performance testing

@Copyright-Abhijeet Patil([email protected])

Hardware Benchmarking

• Now decide upon hardware against which you want to do performance testing o Server Configuration [Processors/RAM/etc.]o OSo Software (e.g. tomcat, java, etc.)o DataBase (version)o If clustered environment (number of nodes, they

way load balancer is configured)• i.e Overall all configuration of system

Page 17: Approaching Performance testing

@Copyright-Abhijeet Patil([email protected])

Execution/Type of tests• For various test types

• Endurance (time)• Step-up Load (user load)• Spike Load (user, time)

• Monitor Server : cpu, memory• Strategy that can be used for each above type

• What load : e.g. Endurance test for various loads (e.g. 50 , 75 , 150 , 350 , 600 , 900 ,etc.)

• Duration : various time duration (e.g. 6hrs , 18 hrs , 24hrs , 30 hrs , etc )

Page 18: Approaching Performance testing

@Copyright-Abhijeet Patil([email protected])

Execution (contd...)

• Distributed load• Number of nodes • Load on each node

Lets talk more about in one of the upcoming slide

Page 19: Approaching Performance testing

@Copyright-Abhijeet Patil([email protected])

Setup Hardware

Setup Test Data

Run Test

Publish Results

Mark as new BenchMark

next Iteration

Finish

No

YesReason for Iteration• New Release

• Hardware Change• Configuration change

Results unacceptable [first iteration]Or

Performance Deterioration [benchmark]

Yes

Performance Improvement/Tuning/

Server monitoringOnly one at a time

No

i.e if performance improvement

Life Cycle

Page 20: Approaching Performance testing

@Copyright-Abhijeet Patil([email protected])

Jenkins

• Helped a lot in current project• Its helps automating end to end performance

test. We can schedule it for over night run• There is a Jenkins plug-in that parses the

Jmeter results • We can always archive results • Anyone can trigger the test without

knowledge of Jmeter.Let go and checkout our Jenkins

Page 22: Approaching Performance testing

@Copyright-Abhijeet Patil([email protected])

• If you would be scalingo Ramo Processoro Node

• Find the factor 'X' which will be used to predict the performance of application if we scale the hardware

• Required incase if you don't want to do performance tuning .

Hardware Scaling

Page 23: Approaching Performance testing

@Copyright-Abhijeet Patil([email protected])

Some Real World Case Studies

• V3 : “Aakho ka dhoka”• Current Project & V2: Registration Looping• Pre-Requisite to automation

• User Registration• Deletion of User

• To test integration points [api’s]

Page 24: Approaching Performance testing

@Copyright-Abhijeet Patil([email protected])

JMeter• How to run test from JMeter

o GUIo Command line argumentso Distributed load generation

• How to create scriptso Recording using Jmeter proxy / Manually createo Extract Dynamic data and send in next requesto Parameterized common things i.e server name ,

port , some test data e.g lat, lon o Configuring test externally from command line

Page 25: Approaching Performance testing

@Copyright-Abhijeet Patil([email protected])

ANY ???

Page 26: Approaching Performance testing

@Copyright-Abhijeet Patil([email protected])

THANK YOU