SlideShare ist ein Scribd-Unternehmen logo
1 von 18
Downloaden Sie, um offline zu lesen
Performance Testing
Apache Benchmark & JMeter
Antoni Orfin
antoniorfin@gmail.com
Performance Testing
Types of testing
Stress test1
Load test2
- Run test from low to high load
- Find the peak for the system
„If we reach more than 100 concurrent
users, the system is slowing down”
- Break the system
- Test if it fails and recovers gracefully (recoverability)
Performance Testing
Apache Benchmark
Download Apache Utils1
Run test2
$ apt-get install apache2-utils
$ ab -n 100 -c 1 http://localhost/
$ ab -n 100 -c 50 http://localhost/
-n requests Number of requests to perform
-c concurrency Number of multiple requests to make at a time
Concurrency does not mean number of
simultaneous users!
Performance Testing
Apache Benchmark
Interpret results3
Server Software: nginx/1.6.2
Server Hostname: localhost
Server Port: 80
Document Path: /
Document Length: 94873 bytes
Concurrency Level: 50
Time taken for tests: 0.094 seconds
Complete requests: 100
Failed requests: 7 (Connect: 0, Receive: 0, Length: 7, Exceptions: 0)
Total transferred: 9503493 bytes
HTML transferred: 9487293 bytes
Requests per second: 1064.54 [#/sec] (mean)
Time per request: 46.969 [ms] (mean)
Time per request: 0.939 [ms] (mean, across all concurrent requests)
Transfer rate: 98797.65 [Kbytes/sec] received
Performance Testing
Apache Benchmark
Load testing4
$ ab -n 10000 -c 10 http://localhost/ # c to low (server is not
$ ab -n 10000 -c 100 http://localhost/ # saturated, response
$ ab -n 10000 -c 250 http://localhost/ # times are stable)
$ ab -n 10000 -c 500 http://localhost/
$ ab -n 10000 -c 750 http://localhost/ # c too high (server is
$ ab -n 10000 -c 1000 http://localhost/ # saturated, response)
times are increasing)
HERE J
Performance Testing
Apache Benchmark
Cons-
- Tests only one URL at the same time.
- Running load test with various concurrency and
collecting results into nice graphs is irritating
- Can’t run distributed test (with multiple test servers)
Pros-
- Zero-configuration
- Easy to learn and to run first test
- Small CPU/memory footprint
Performance Testing
Apache JMeter
Download JMeter1
Download JMeter Plugins2
http://jmeter.apache.org/download_jmeter.cgi
Plugin manager: https://jmeter-plugins.org/install/Install/
Plugins, mostly:
https://jmeter-plugins.org/wiki/Start/#Thread-Groups
https://jmeter-plugins.org/wiki/Start/#Graphs
Performance Testing
Apache JMeter
Sample load-test scenario3
Performance Testing
Apache JMeter
Definining parameters4
- Define variables in „User Defined Variables”
- Allow to pass variables via CLI
${__P(host,${host})} - will use value from „host” CLI
argument or from ”User Defined Variables” if not
passed.
$ ./bin/jmeter -t scenario.jmx -Jhost my-host.com
HINT
Performance Testing
Apache JMeter
Using CSV file with URLs5
- You can test multiple URLs in a single load-test
- Group results by categorizing URLs
Sample CSV:
Homepage,/
Category,/wallmurals
Category,/prints-and-posters
ProductPage,/wallmurals/cat-425225252
ProductPage,/stickers/dog-12789
Performance Testing
Apache JMeter
Defining threads scenario6
- Use „Concurrency Thread Group” (from JMeter
Plugins) to test how your website behaves under
increasing number of threads
HINT
Performance Testing
Apache JMeter
Making HTTP Request7
- As a „Name” use variable from CSV file (that will group results)
- You can include also other parameters in CSV (e.g. method,
protocol)
- To avoid network latencies use HEAD HTTP method
- server will return empty responses
- may depend on your application/server’s configuration
Performance Testing
Apache JMeter
Moving „Concurrent Threads” into Real Users8
- Find out Average Time on Page (not average session) in your
Google Analytics
- Use „Gaussian Random Timer” to add some randomized delay
after each request
Performance Testing
Apache JMeter
Getting statistics from Google Analytics9
Nb of concurrent users:
concurrent_users = (peak_hourly_visits * average_session_duration) / 3600
e.g. 540 * 201 sec / 3600 sec = 30 users
Peak traffic: (peak_hourly_pageviews / 3600)
e.g. 21000 / 3600 = 5,83 req/s
Peak
21.000 pageviews
Performance Testing
Apache JMeter
Running test10
$ ./bin/jmeter -t scenario.jmx -n –l results.jtl
Collecting results11
- Always run tests from CLI (non-interaction mode) to avoid
memory/CPU problems
- Use „Graphs Generator” (from JMeter plugins) that
automatically saves graphs after the test.
- …or preview results online: https://sense.blazemeter.com/gui/
Performance Testing
Apache JMeter
Cons-
- Difficult to configure (Java & JMeter needs to be
properly tuned-up)
- Sometimes results are not so straightforward to
interpret
Pros-
- Can test multiple URLs in a single load-test
- Can run distributed tests, even in cloud
(e.g. www.blazemeter.com)
- Can be easily integrated into CI (Jenkins plugin)
- Allows to compose complex scenarios, even with Selenium
Performance Testing
General hints
- Different machines: Never run tests on the same machine that
application is running
- The same datacenter: To avoid network latencies (ping), it’s better
to run tests from the same datacenter as the target application.
- Rent cloud with hourly pricing: Amazon EC2 „on-demand”
instances are great for short load test:
1. Prepare your test scenario and JMeter installation
2. Rent EC2 instance just for the time that will be needed to finish
the test.
- Watch out for production infrastructure:
1. If you don’t have separate infrastructure to test (cloned
production), run tests during the lowest traffic (e.g. at night).
2. 80% probability that you will take-down the application during
the load test.
Contact me at:
antoniorfin@gmail.com
linkedin.com/in/antoniorfin
twitter.com/antoniorfin
www.pixersize.com
Thank you!
Questions & Answers

Weitere ähnliche Inhalte

Was ist angesagt?

Apache JMeter - A brief introduction
Apache JMeter - A brief introductionApache JMeter - A brief introduction
Apache JMeter - A brief introductionsilenceIT Inc.
 
Introduction of TestNG framework and its benefits over Junit framework
Introduction of TestNG framework and its benefits over Junit frameworkIntroduction of TestNG framework and its benefits over Junit framework
Introduction of TestNG framework and its benefits over Junit frameworkBugRaptors
 
Interview questions for manual testing technology.
Interview questions for manual testing technology.Interview questions for manual testing technology.
Interview questions for manual testing technology.Vinay Agnihotri
 
Performance testing with Jmeter
Performance testing with JmeterPerformance testing with Jmeter
Performance testing with JmeterPrashanth Kumar
 
Performance testing and reporting with JMeter
Performance testing and reporting with JMeterPerformance testing and reporting with JMeter
Performance testing and reporting with JMeterjvSlideshare
 
Introduction to jmeter
Introduction to jmeterIntroduction to jmeter
Introduction to jmetertest test
 
Manual Testing Notes
Manual Testing NotesManual Testing Notes
Manual Testing Notesguest208aa1
 
5 black box and grey box testing
5   black box and grey box testing5   black box and grey box testing
5 black box and grey box testingYisal Khan
 
Hybrid Automation Framework Development introduction
Hybrid Automation Framework Development introductionHybrid Automation Framework Development introduction
Hybrid Automation Framework Development introductionGanuka Yashantha
 
TestNG Annotations in Selenium | Edureka
TestNG Annotations in Selenium | EdurekaTestNG Annotations in Selenium | Edureka
TestNG Annotations in Selenium | EdurekaEdureka!
 
Manual testing interview questions and answers
Manual testing interview questions and answersManual testing interview questions and answers
Manual testing interview questions and answerskaranmca
 
Intro to Manual Testing
Intro to Manual TestingIntro to Manual Testing
Intro to Manual TestingAyah Soufan
 
Top 20 best automation testing tools
Top 20 best automation testing toolsTop 20 best automation testing tools
Top 20 best automation testing toolsQACraft
 
Performance testing using Jmeter for apps which needs authentication
Performance testing using Jmeter for apps which needs authenticationPerformance testing using Jmeter for apps which needs authentication
Performance testing using Jmeter for apps which needs authenticationJay Jha
 
Performance Testing With Jmeter
Performance Testing With JmeterPerformance Testing With Jmeter
Performance Testing With JmeterAdam Goucher
 
Test automation methodologies
Test automation methodologiesTest automation methodologies
Test automation methodologiesMesut Günes
 
Manual testing real time questions by subbu
Manual testing real time questions by subbuManual testing real time questions by subbu
Manual testing real time questions by subbupalla subrahmanyam
 
Basic Guide to Manual Testing
Basic Guide to Manual TestingBasic Guide to Manual Testing
Basic Guide to Manual TestingHiral Gosani
 

Was ist angesagt? (20)

Apache JMeter - A brief introduction
Apache JMeter - A brief introductionApache JMeter - A brief introduction
Apache JMeter - A brief introduction
 
Introduction of TestNG framework and its benefits over Junit framework
Introduction of TestNG framework and its benefits over Junit frameworkIntroduction of TestNG framework and its benefits over Junit framework
Introduction of TestNG framework and its benefits over Junit framework
 
Interview questions for manual testing technology.
Interview questions for manual testing technology.Interview questions for manual testing technology.
Interview questions for manual testing technology.
 
Performance testing with Jmeter
Performance testing with JmeterPerformance testing with Jmeter
Performance testing with Jmeter
 
TestNG
TestNGTestNG
TestNG
 
Performance testing and reporting with JMeter
Performance testing and reporting with JMeterPerformance testing and reporting with JMeter
Performance testing and reporting with JMeter
 
Introduction to jmeter
Introduction to jmeterIntroduction to jmeter
Introduction to jmeter
 
Manual Testing Notes
Manual Testing NotesManual Testing Notes
Manual Testing Notes
 
5 black box and grey box testing
5   black box and grey box testing5   black box and grey box testing
5 black box and grey box testing
 
Hybrid Automation Framework Development introduction
Hybrid Automation Framework Development introductionHybrid Automation Framework Development introduction
Hybrid Automation Framework Development introduction
 
TestNG Annotations in Selenium | Edureka
TestNG Annotations in Selenium | EdurekaTestNG Annotations in Selenium | Edureka
TestNG Annotations in Selenium | Edureka
 
Manual testing interview questions and answers
Manual testing interview questions and answersManual testing interview questions and answers
Manual testing interview questions and answers
 
Intro to Manual Testing
Intro to Manual TestingIntro to Manual Testing
Intro to Manual Testing
 
Selenium-Locators
Selenium-LocatorsSelenium-Locators
Selenium-Locators
 
Top 20 best automation testing tools
Top 20 best automation testing toolsTop 20 best automation testing tools
Top 20 best automation testing tools
 
Performance testing using Jmeter for apps which needs authentication
Performance testing using Jmeter for apps which needs authenticationPerformance testing using Jmeter for apps which needs authentication
Performance testing using Jmeter for apps which needs authentication
 
Performance Testing With Jmeter
Performance Testing With JmeterPerformance Testing With Jmeter
Performance Testing With Jmeter
 
Test automation methodologies
Test automation methodologiesTest automation methodologies
Test automation methodologies
 
Manual testing real time questions by subbu
Manual testing real time questions by subbuManual testing real time questions by subbu
Manual testing real time questions by subbu
 
Basic Guide to Manual Testing
Basic Guide to Manual TestingBasic Guide to Manual Testing
Basic Guide to Manual Testing
 

Ähnlich wie Performance Testing - Apache Benchmark, JMeter

Mastering Distributed Performance Testing
Mastering Distributed Performance TestingMastering Distributed Performance Testing
Mastering Distributed Performance TestingKnoldus Inc.
 
Load Test Drupal Site Using JMeter and Amazon AWS
Load Test Drupal Site Using JMeter and Amazon AWSLoad Test Drupal Site Using JMeter and Amazon AWS
Load Test Drupal Site Using JMeter and Amazon AWSVladimir Ilic
 
"Introduction to JMeter" @ CPTM 3rd Session
"Introduction to JMeter" @ CPTM 3rd Session"Introduction to JMeter" @ CPTM 3rd Session
"Introduction to JMeter" @ CPTM 3rd SessionTharinda Liyanage
 
Day5_Apache_JMeter_Test_Execution_RemoteMode_Master_Slave
Day5_Apache_JMeter_Test_Execution_RemoteMode_Master_SlaveDay5_Apache_JMeter_Test_Execution_RemoteMode_Master_Slave
Day5_Apache_JMeter_Test_Execution_RemoteMode_Master_SlaveSravanthi N
 
Basic of jMeter
Basic of jMeter Basic of jMeter
Basic of jMeter Shub
 
Performance testing jmeter
Performance testing jmeterPerformance testing jmeter
Performance testing jmeterBhojan Rajan
 
Performancetestingjmeter 131210111657-phpapp02
Performancetestingjmeter 131210111657-phpapp02Performancetestingjmeter 131210111657-phpapp02
Performancetestingjmeter 131210111657-phpapp02Nitish Bhardwaj
 
Performance testing and j meter
Performance testing and j meterPerformance testing and j meter
Performance testing and j meterPurna Chandar
 
Performancetestingjmeter 121109061704-phpapp02
Performancetestingjmeter 121109061704-phpapp02Performancetestingjmeter 121109061704-phpapp02
Performancetestingjmeter 121109061704-phpapp02Shivakumara .
 
QA. Load Testing
QA. Load TestingQA. Load Testing
QA. Load TestingAlex Galkin
 
Presto Testing Tools: Benchto & Tempto (Presto Boston Meetup 10062015)
Presto Testing Tools: Benchto & Tempto (Presto Boston Meetup 10062015)Presto Testing Tools: Benchto & Tempto (Presto Boston Meetup 10062015)
Presto Testing Tools: Benchto & Tempto (Presto Boston Meetup 10062015)Matt Fuller
 
JMeter & ColdFusion
JMeter & ColdFusion JMeter & ColdFusion
JMeter & ColdFusion isummation
 
Managing big test environment and running tests with Jenkins, Jenkins Job bui...
Managing big test environment and running tests with Jenkins, Jenkins Job bui...Managing big test environment and running tests with Jenkins, Jenkins Job bui...
Managing big test environment and running tests with Jenkins, Jenkins Job bui...Timofey Turenko
 
Day1_Apache_JMeter_Overview
Day1_Apache_JMeter_OverviewDay1_Apache_JMeter_Overview
Day1_Apache_JMeter_OverviewSravanthi N
 
Best Jmeter Interview Questions- Prepared by Working Professionals
Best Jmeter Interview Questions- Prepared by Working ProfessionalsBest Jmeter Interview Questions- Prepared by Working Professionals
Best Jmeter Interview Questions- Prepared by Working ProfessionalsTesting World
 
Software testing
Software testingSoftware testing
Software testingnil65
 

Ähnlich wie Performance Testing - Apache Benchmark, JMeter (20)

Mastering Distributed Performance Testing
Mastering Distributed Performance TestingMastering Distributed Performance Testing
Mastering Distributed Performance Testing
 
Performance testing meets the cloud - Artem Shendrikov
Performance testing meets the cloud -  Artem ShendrikovPerformance testing meets the cloud -  Artem Shendrikov
Performance testing meets the cloud - Artem Shendrikov
 
Load Test Drupal Site Using JMeter and Amazon AWS
Load Test Drupal Site Using JMeter and Amazon AWSLoad Test Drupal Site Using JMeter and Amazon AWS
Load Test Drupal Site Using JMeter and Amazon AWS
 
"Introduction to JMeter" @ CPTM 3rd Session
"Introduction to JMeter" @ CPTM 3rd Session"Introduction to JMeter" @ CPTM 3rd Session
"Introduction to JMeter" @ CPTM 3rd Session
 
apache_jmeter.pptx
apache_jmeter.pptxapache_jmeter.pptx
apache_jmeter.pptx
 
Day5_Apache_JMeter_Test_Execution_RemoteMode_Master_Slave
Day5_Apache_JMeter_Test_Execution_RemoteMode_Master_SlaveDay5_Apache_JMeter_Test_Execution_RemoteMode_Master_Slave
Day5_Apache_JMeter_Test_Execution_RemoteMode_Master_Slave
 
Basic of jMeter
Basic of jMeter Basic of jMeter
Basic of jMeter
 
Performance testing jmeter
Performance testing jmeterPerformance testing jmeter
Performance testing jmeter
 
Performancetestingjmeter 131210111657-phpapp02
Performancetestingjmeter 131210111657-phpapp02Performancetestingjmeter 131210111657-phpapp02
Performancetestingjmeter 131210111657-phpapp02
 
Performance testing and j meter
Performance testing and j meterPerformance testing and j meter
Performance testing and j meter
 
JMeter-UCCSC.pdf
JMeter-UCCSC.pdfJMeter-UCCSC.pdf
JMeter-UCCSC.pdf
 
Performancetestingjmeter 121109061704-phpapp02
Performancetestingjmeter 121109061704-phpapp02Performancetestingjmeter 121109061704-phpapp02
Performancetestingjmeter 121109061704-phpapp02
 
QA. Load Testing
QA. Load TestingQA. Load Testing
QA. Load Testing
 
Presto Testing Tools: Benchto & Tempto (Presto Boston Meetup 10062015)
Presto Testing Tools: Benchto & Tempto (Presto Boston Meetup 10062015)Presto Testing Tools: Benchto & Tempto (Presto Boston Meetup 10062015)
Presto Testing Tools: Benchto & Tempto (Presto Boston Meetup 10062015)
 
JMeter & ColdFusion
JMeter & ColdFusion JMeter & ColdFusion
JMeter & ColdFusion
 
Managing big test environment and running tests with Jenkins, Jenkins Job bui...
Managing big test environment and running tests with Jenkins, Jenkins Job bui...Managing big test environment and running tests with Jenkins, Jenkins Job bui...
Managing big test environment and running tests with Jenkins, Jenkins Job bui...
 
Day1_Apache_JMeter_Overview
Day1_Apache_JMeter_OverviewDay1_Apache_JMeter_Overview
Day1_Apache_JMeter_Overview
 
Best Jmeter Interview Questions- Prepared by Working Professionals
Best Jmeter Interview Questions- Prepared by Working ProfessionalsBest Jmeter Interview Questions- Prepared by Working Professionals
Best Jmeter Interview Questions- Prepared by Working Professionals
 
Lesson 2
Lesson 2Lesson 2
Lesson 2
 
Software testing
Software testingSoftware testing
Software testing
 

Mehr von Antoni Orfin

Beyond Continuous Delivery
Beyond Continuous DeliveryBeyond Continuous Delivery
Beyond Continuous DeliveryAntoni Orfin
 
A Year of Droplr Cloud Architecture Evolution with AWS and Serverless
A Year of Droplr Cloud Architecture Evolution with AWS and ServerlessA Year of Droplr Cloud Architecture Evolution with AWS and Serverless
A Year of Droplr Cloud Architecture Evolution with AWS and ServerlessAntoni Orfin
 
Future of Cloud Starts with Serverless
Future of Cloud Starts with ServerlessFuture of Cloud Starts with Serverless
Future of Cloud Starts with ServerlessAntoni Orfin
 
Droplr Serverless Revolution - How we killed 50 servers in a year
Droplr Serverless Revolution - How we killed 50 servers in a yearDroplr Serverless Revolution - How we killed 50 servers in a year
Droplr Serverless Revolution - How we killed 50 servers in a yearAntoni Orfin
 
Testowanie poziomu bezpieczeństwa aplikacji internetowych
Testowanie poziomu bezpieczeństwa aplikacji internetowychTestowanie poziomu bezpieczeństwa aplikacji internetowych
Testowanie poziomu bezpieczeństwa aplikacji internetowychAntoni Orfin
 
Projektowanie wysokowydajnych i skalowalnych serwisów WWW - Warstwa danych
Projektowanie wysokowydajnych i skalowalnych serwisów WWW - Warstwa danychProjektowanie wysokowydajnych i skalowalnych serwisów WWW - Warstwa danych
Projektowanie wysokowydajnych i skalowalnych serwisów WWW - Warstwa danychAntoni Orfin
 
Projektowanie wysokowydajnych i skalowalnych serwisów WWW - Warstwa aplikacji
Projektowanie wysokowydajnych i skalowalnych serwisów WWW - Warstwa aplikacjiProjektowanie wysokowydajnych i skalowalnych serwisów WWW - Warstwa aplikacji
Projektowanie wysokowydajnych i skalowalnych serwisów WWW - Warstwa aplikacjiAntoni Orfin
 
Elasticsearch - Guide to Search
Elasticsearch - Guide to SearchElasticsearch - Guide to Search
Elasticsearch - Guide to SearchAntoni Orfin
 

Mehr von Antoni Orfin (9)

Beyond Continuous Delivery
Beyond Continuous DeliveryBeyond Continuous Delivery
Beyond Continuous Delivery
 
A Year of Droplr Cloud Architecture Evolution with AWS and Serverless
A Year of Droplr Cloud Architecture Evolution with AWS and ServerlessA Year of Droplr Cloud Architecture Evolution with AWS and Serverless
A Year of Droplr Cloud Architecture Evolution with AWS and Serverless
 
Future of Cloud Starts with Serverless
Future of Cloud Starts with ServerlessFuture of Cloud Starts with Serverless
Future of Cloud Starts with Serverless
 
Droplr Serverless Revolution - How we killed 50 servers in a year
Droplr Serverless Revolution - How we killed 50 servers in a yearDroplr Serverless Revolution - How we killed 50 servers in a year
Droplr Serverless Revolution - How we killed 50 servers in a year
 
DevOps in Droplr
DevOps in DroplrDevOps in Droplr
DevOps in Droplr
 
Testowanie poziomu bezpieczeństwa aplikacji internetowych
Testowanie poziomu bezpieczeństwa aplikacji internetowychTestowanie poziomu bezpieczeństwa aplikacji internetowych
Testowanie poziomu bezpieczeństwa aplikacji internetowych
 
Projektowanie wysokowydajnych i skalowalnych serwisów WWW - Warstwa danych
Projektowanie wysokowydajnych i skalowalnych serwisów WWW - Warstwa danychProjektowanie wysokowydajnych i skalowalnych serwisów WWW - Warstwa danych
Projektowanie wysokowydajnych i skalowalnych serwisów WWW - Warstwa danych
 
Projektowanie wysokowydajnych i skalowalnych serwisów WWW - Warstwa aplikacji
Projektowanie wysokowydajnych i skalowalnych serwisów WWW - Warstwa aplikacjiProjektowanie wysokowydajnych i skalowalnych serwisów WWW - Warstwa aplikacji
Projektowanie wysokowydajnych i skalowalnych serwisów WWW - Warstwa aplikacji
 
Elasticsearch - Guide to Search
Elasticsearch - Guide to SearchElasticsearch - Guide to Search
Elasticsearch - Guide to Search
 

Kürzlich hochgeladen

Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusZilliz
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...apidays
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfOrbitshub
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamUiPathCommunity
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Bhuvaneswari Subramani
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Angeliki Cooney
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 

Kürzlich hochgeladen (20)

Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 

Performance Testing - Apache Benchmark, JMeter

  • 1. Performance Testing Apache Benchmark & JMeter Antoni Orfin antoniorfin@gmail.com
  • 2. Performance Testing Types of testing Stress test1 Load test2 - Run test from low to high load - Find the peak for the system „If we reach more than 100 concurrent users, the system is slowing down” - Break the system - Test if it fails and recovers gracefully (recoverability)
  • 3. Performance Testing Apache Benchmark Download Apache Utils1 Run test2 $ apt-get install apache2-utils $ ab -n 100 -c 1 http://localhost/ $ ab -n 100 -c 50 http://localhost/ -n requests Number of requests to perform -c concurrency Number of multiple requests to make at a time Concurrency does not mean number of simultaneous users!
  • 4. Performance Testing Apache Benchmark Interpret results3 Server Software: nginx/1.6.2 Server Hostname: localhost Server Port: 80 Document Path: / Document Length: 94873 bytes Concurrency Level: 50 Time taken for tests: 0.094 seconds Complete requests: 100 Failed requests: 7 (Connect: 0, Receive: 0, Length: 7, Exceptions: 0) Total transferred: 9503493 bytes HTML transferred: 9487293 bytes Requests per second: 1064.54 [#/sec] (mean) Time per request: 46.969 [ms] (mean) Time per request: 0.939 [ms] (mean, across all concurrent requests) Transfer rate: 98797.65 [Kbytes/sec] received
  • 5. Performance Testing Apache Benchmark Load testing4 $ ab -n 10000 -c 10 http://localhost/ # c to low (server is not $ ab -n 10000 -c 100 http://localhost/ # saturated, response $ ab -n 10000 -c 250 http://localhost/ # times are stable) $ ab -n 10000 -c 500 http://localhost/ $ ab -n 10000 -c 750 http://localhost/ # c too high (server is $ ab -n 10000 -c 1000 http://localhost/ # saturated, response) times are increasing) HERE J
  • 6. Performance Testing Apache Benchmark Cons- - Tests only one URL at the same time. - Running load test with various concurrency and collecting results into nice graphs is irritating - Can’t run distributed test (with multiple test servers) Pros- - Zero-configuration - Easy to learn and to run first test - Small CPU/memory footprint
  • 7. Performance Testing Apache JMeter Download JMeter1 Download JMeter Plugins2 http://jmeter.apache.org/download_jmeter.cgi Plugin manager: https://jmeter-plugins.org/install/Install/ Plugins, mostly: https://jmeter-plugins.org/wiki/Start/#Thread-Groups https://jmeter-plugins.org/wiki/Start/#Graphs
  • 9. Performance Testing Apache JMeter Definining parameters4 - Define variables in „User Defined Variables” - Allow to pass variables via CLI ${__P(host,${host})} - will use value from „host” CLI argument or from ”User Defined Variables” if not passed. $ ./bin/jmeter -t scenario.jmx -Jhost my-host.com HINT
  • 10. Performance Testing Apache JMeter Using CSV file with URLs5 - You can test multiple URLs in a single load-test - Group results by categorizing URLs Sample CSV: Homepage,/ Category,/wallmurals Category,/prints-and-posters ProductPage,/wallmurals/cat-425225252 ProductPage,/stickers/dog-12789
  • 11. Performance Testing Apache JMeter Defining threads scenario6 - Use „Concurrency Thread Group” (from JMeter Plugins) to test how your website behaves under increasing number of threads
  • 12. HINT Performance Testing Apache JMeter Making HTTP Request7 - As a „Name” use variable from CSV file (that will group results) - You can include also other parameters in CSV (e.g. method, protocol) - To avoid network latencies use HEAD HTTP method - server will return empty responses - may depend on your application/server’s configuration
  • 13. Performance Testing Apache JMeter Moving „Concurrent Threads” into Real Users8 - Find out Average Time on Page (not average session) in your Google Analytics - Use „Gaussian Random Timer” to add some randomized delay after each request
  • 14. Performance Testing Apache JMeter Getting statistics from Google Analytics9 Nb of concurrent users: concurrent_users = (peak_hourly_visits * average_session_duration) / 3600 e.g. 540 * 201 sec / 3600 sec = 30 users Peak traffic: (peak_hourly_pageviews / 3600) e.g. 21000 / 3600 = 5,83 req/s Peak 21.000 pageviews
  • 15. Performance Testing Apache JMeter Running test10 $ ./bin/jmeter -t scenario.jmx -n –l results.jtl Collecting results11 - Always run tests from CLI (non-interaction mode) to avoid memory/CPU problems - Use „Graphs Generator” (from JMeter plugins) that automatically saves graphs after the test. - …or preview results online: https://sense.blazemeter.com/gui/
  • 16. Performance Testing Apache JMeter Cons- - Difficult to configure (Java & JMeter needs to be properly tuned-up) - Sometimes results are not so straightforward to interpret Pros- - Can test multiple URLs in a single load-test - Can run distributed tests, even in cloud (e.g. www.blazemeter.com) - Can be easily integrated into CI (Jenkins plugin) - Allows to compose complex scenarios, even with Selenium
  • 17. Performance Testing General hints - Different machines: Never run tests on the same machine that application is running - The same datacenter: To avoid network latencies (ping), it’s better to run tests from the same datacenter as the target application. - Rent cloud with hourly pricing: Amazon EC2 „on-demand” instances are great for short load test: 1. Prepare your test scenario and JMeter installation 2. Rent EC2 instance just for the time that will be needed to finish the test. - Watch out for production infrastructure: 1. If you don’t have separate infrastructure to test (cloned production), run tests during the lowest traffic (e.g. at night). 2. 80% probability that you will take-down the application during the load test.