SlideShare uma empresa Scribd logo
1 de 18
Baixar para ler offline
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

Mais conteúdo relacionado

Mais procurados

How to Analyze Reports in Jmeter
How to Analyze Reports in JmeterHow to Analyze Reports in Jmeter
How to Analyze Reports in JmeterViviana Lesmes
 
Performance testing with JMeter
Performance testing with JMeterPerformance testing with JMeter
Performance testing with JMeterMikael Kundert
 
Apache JMeter - A brief introduction
Apache JMeter - A brief introductionApache JMeter - A brief introduction
Apache JMeter - A brief introductionsilenceIT Inc.
 
Performance Test Plan - Sample 1
Performance Test Plan - Sample 1Performance Test Plan - Sample 1
Performance Test Plan - Sample 1Atul Pant
 
Performance testing and reporting with JMeter
Performance testing and reporting with JMeterPerformance testing and reporting with JMeter
Performance testing and reporting with JMeterjvSlideshare
 
Performance testing with jmeter
Performance testing with jmeter Performance testing with jmeter
Performance testing with jmeter Knoldus Inc.
 
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
 
Mesurer les performances avec JMeter
Mesurer les performances avec JMeterMesurer les performances avec JMeter
Mesurer les performances avec JMeterClaude Falguiere
 
Introduction to performance testing
Introduction to performance testingIntroduction to performance testing
Introduction to performance testingRichard Bishop
 
Performance testing with Jmeter
Performance testing with JmeterPerformance testing with Jmeter
Performance testing with JmeterPrashanth Kumar
 
QA. Load Testing
QA. Load TestingQA. Load Testing
QA. Load TestingAlex Galkin
 
Performance testing : An Overview
Performance testing : An OverviewPerformance testing : An Overview
Performance testing : An Overviewsharadkjain
 
Performance and load testing
Performance and load testingPerformance and load testing
Performance and load testingsonukalpana
 
Automation - Apache JMeter
Automation - Apache JMeterAutomation - Apache JMeter
Automation - Apache JMeterWira Santos
 
Performance Testing And Its Type | Benefits Of Performance Testing
Performance Testing And Its Type | Benefits Of Performance TestingPerformance Testing And Its Type | Benefits Of Performance Testing
Performance Testing And Its Type | Benefits Of Performance TestingKostCare
 
Framework For Automation Testing Practice Sharing
Framework For Automation Testing Practice SharingFramework For Automation Testing Practice Sharing
Framework For Automation Testing Practice SharingKMS Technology
 
Load Testing Best Practices
Load Testing Best PracticesLoad Testing Best Practices
Load Testing Best PracticesApica
 

Mais procurados (20)

How to Analyze Reports in Jmeter
How to Analyze Reports in JmeterHow to Analyze Reports in Jmeter
How to Analyze Reports in Jmeter
 
Performance testing with JMeter
Performance testing with JMeterPerformance testing with JMeter
Performance testing with JMeter
 
Apache JMeter - A brief introduction
Apache JMeter - A brief introductionApache JMeter - A brief introduction
Apache JMeter - A brief introduction
 
Performance Test Plan - Sample 1
Performance Test Plan - Sample 1Performance Test Plan - Sample 1
Performance Test Plan - Sample 1
 
Performance testing and reporting with JMeter
Performance testing and reporting with JMeterPerformance testing and reporting with JMeter
Performance testing and reporting with JMeter
 
Performance testing with jmeter
Performance testing with jmeter Performance testing with jmeter
Performance testing with jmeter
 
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
 
J Meter Intro
J Meter IntroJ Meter Intro
J Meter Intro
 
Mesurer les performances avec JMeter
Mesurer les performances avec JMeterMesurer les performances avec JMeter
Mesurer les performances avec JMeter
 
Introduction to performance testing
Introduction to performance testingIntroduction to performance testing
Introduction to performance testing
 
Performance testing with Jmeter
Performance testing with JmeterPerformance testing with Jmeter
Performance testing with Jmeter
 
QA. Load Testing
QA. Load TestingQA. Load Testing
QA. Load Testing
 
Performance testing : An Overview
Performance testing : An OverviewPerformance testing : An Overview
Performance testing : An Overview
 
Performance and load testing
Performance and load testingPerformance and load testing
Performance and load testing
 
Automation - Apache JMeter
Automation - Apache JMeterAutomation - Apache JMeter
Automation - Apache JMeter
 
Performance Testing And Its Type | Benefits Of Performance Testing
Performance Testing And Its Type | Benefits Of Performance TestingPerformance Testing And Its Type | Benefits Of Performance Testing
Performance Testing And Its Type | Benefits Of Performance Testing
 
Framework For Automation Testing Practice Sharing
Framework For Automation Testing Practice SharingFramework For Automation Testing Practice Sharing
Framework For Automation Testing Practice Sharing
 
Load Testing Best Practices
Load Testing Best PracticesLoad Testing Best Practices
Load Testing Best Practices
 
Jmeter
JmeterJmeter
Jmeter
 
How to start performance testing project
How to start performance testing projectHow to start performance testing project
How to start performance testing project
 

Semelhante a 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
 
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 .
 
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
 
Jmeter_Presentaion_Parag
Jmeter_Presentaion_ParagJmeter_Presentaion_Parag
Jmeter_Presentaion_ParagPARAG KHEDIKAR
 

Semelhante a 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
 
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
 
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
 
Beyond Unit Testing
Beyond Unit TestingBeyond Unit Testing
Beyond Unit Testing
 
Jmeter_Presentaion_Parag
Jmeter_Presentaion_ParagJmeter_Presentaion_Parag
Jmeter_Presentaion_Parag
 

Mais de 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
 

Mais de 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
 

Último

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Principled Technologies
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024The Digital Insurer
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
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
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
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
 

Último (20)

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
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 New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
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
 

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.