SlideShare a Scribd company logo
1 of 18
Download to read 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

More Related Content

What's hot

Apache JMeter - A brief introduction
Apache JMeter - A brief introductionApache JMeter - A brief introduction
Apache JMeter - A brief introductionsilenceIT Inc.
 
Performance testing with jmeter
Performance testing with jmeter Performance testing with jmeter
Performance testing with jmeter Knoldus Inc.
 
Performance testing jmeter
Performance testing jmeterPerformance testing jmeter
Performance testing jmeterBhojan Rajan
 
JMeter vs LoadRunner | Edureka
JMeter vs LoadRunner | EdurekaJMeter vs LoadRunner | Edureka
JMeter vs LoadRunner | EdurekaEdureka!
 
Jmeter Performance Testing
Jmeter Performance TestingJmeter Performance Testing
Jmeter Performance TestingAtul Pant
 
Rethinking Best Practices
Rethinking Best PracticesRethinking Best Practices
Rethinking Best Practicesfloydophone
 
Playwright: A New Test Automation Framework for the Modern Web
Playwright: A New Test Automation Framework for the Modern WebPlaywright: A New Test Automation Framework for the Modern Web
Playwright: A New Test Automation Framework for the Modern WebApplitools
 
Web automation using selenium.ppt
Web automation using selenium.pptWeb automation using selenium.ppt
Web automation using selenium.pptAna Sarbescu
 
Basic of jMeter
Basic of jMeter Basic of jMeter
Basic of jMeter Shub
 
Selenium WebDriver Tutorial For Beginners | What Is Selenium WebDriver | Sele...
Selenium WebDriver Tutorial For Beginners | What Is Selenium WebDriver | Sele...Selenium WebDriver Tutorial For Beginners | What Is Selenium WebDriver | Sele...
Selenium WebDriver Tutorial For Beginners | What Is Selenium WebDriver | Sele...Edureka!
 
Selenium introduction
Selenium introductionSelenium introduction
Selenium introductionPankaj Dubey
 
Automating security test using Selenium and OWASP ZAP - Practical DevSecOps
Automating security test using Selenium and OWASP ZAP - Practical DevSecOpsAutomating security test using Selenium and OWASP ZAP - Practical DevSecOps
Automating security test using Selenium and OWASP ZAP - Practical DevSecOpsMohammed A. Imran
 
CI/CT/CD and Role of Quality Engineering
CI/CT/CD and Role of Quality EngineeringCI/CT/CD and Role of Quality Engineering
CI/CT/CD and Role of Quality EngineeringSushma
 
Performance testing and reporting with JMeter
Performance testing and reporting with JMeterPerformance testing and reporting with JMeter
Performance testing and reporting with JMeterjvSlideshare
 
Test Automation With Cucumber JVM, Selenium, and Mocha
Test Automation With Cucumber JVM, Selenium, and MochaTest Automation With Cucumber JVM, Selenium, and Mocha
Test Automation With Cucumber JVM, Selenium, and MochaSalesforce Developers
 

What's hot (20)

Apache JMeter - A brief introduction
Apache JMeter - A brief introductionApache JMeter - A brief introduction
Apache JMeter - A brief introduction
 
Performance testing with jmeter
Performance testing with jmeter Performance testing with jmeter
Performance testing with jmeter
 
Performance testing jmeter
Performance testing jmeterPerformance testing jmeter
Performance testing jmeter
 
JMeter vs LoadRunner | Edureka
JMeter vs LoadRunner | EdurekaJMeter vs LoadRunner | Edureka
JMeter vs LoadRunner | Edureka
 
Automation Testing by Selenium Web Driver
Automation Testing by Selenium Web DriverAutomation Testing by Selenium Web Driver
Automation Testing by Selenium Web Driver
 
Jmeter Performance Testing
Jmeter Performance TestingJmeter Performance Testing
Jmeter Performance Testing
 
Introduction to Selenium Web Driver
Introduction to Selenium Web DriverIntroduction to Selenium Web Driver
Introduction to Selenium Web Driver
 
Rethinking Best Practices
Rethinking Best PracticesRethinking Best Practices
Rethinking Best Practices
 
Playwright: A New Test Automation Framework for the Modern Web
Playwright: A New Test Automation Framework for the Modern WebPlaywright: A New Test Automation Framework for the Modern Web
Playwright: A New Test Automation Framework for the Modern Web
 
Web automation using selenium.ppt
Web automation using selenium.pptWeb automation using selenium.ppt
Web automation using selenium.ppt
 
Basic of jMeter
Basic of jMeter Basic of jMeter
Basic of jMeter
 
SELENIUM PPT.pdf
SELENIUM PPT.pdfSELENIUM PPT.pdf
SELENIUM PPT.pdf
 
Test Automation Framework with BDD and Cucumber
Test Automation Framework with BDD and CucumberTest Automation Framework with BDD and Cucumber
Test Automation Framework with BDD and Cucumber
 
Selenium WebDriver Tutorial For Beginners | What Is Selenium WebDriver | Sele...
Selenium WebDriver Tutorial For Beginners | What Is Selenium WebDriver | Sele...Selenium WebDriver Tutorial For Beginners | What Is Selenium WebDriver | Sele...
Selenium WebDriver Tutorial For Beginners | What Is Selenium WebDriver | Sele...
 
Selenium introduction
Selenium introductionSelenium introduction
Selenium introduction
 
Automating security test using Selenium and OWASP ZAP - Practical DevSecOps
Automating security test using Selenium and OWASP ZAP - Practical DevSecOpsAutomating security test using Selenium and OWASP ZAP - Practical DevSecOps
Automating security test using Selenium and OWASP ZAP - Practical DevSecOps
 
Cypress
CypressCypress
Cypress
 
CI/CT/CD and Role of Quality Engineering
CI/CT/CD and Role of Quality EngineeringCI/CT/CD and Role of Quality Engineering
CI/CT/CD and Role of Quality Engineering
 
Performance testing and reporting with JMeter
Performance testing and reporting with JMeterPerformance testing and reporting with JMeter
Performance testing and reporting with JMeter
 
Test Automation With Cucumber JVM, Selenium, and Mocha
Test Automation With Cucumber JVM, Selenium, and MochaTest Automation With Cucumber JVM, Selenium, and Mocha
Test Automation With Cucumber JVM, Selenium, and Mocha
 

Similar to Optimize Apache JMeter load testing with plugins

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

Similar to Optimize Apache JMeter load testing with plugins (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
 
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
 
Beyond Unit Testing
Beyond Unit TestingBeyond Unit Testing
Beyond Unit Testing
 
Jmeter_Presentaion_Parag
Jmeter_Presentaion_ParagJmeter_Presentaion_Parag
Jmeter_Presentaion_Parag
 

More from 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
 

More from 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
 

Recently uploaded

The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...panagenda
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI AgeCprime
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfpanagenda
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Alkin Tezuysal
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Strongerpanagenda
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesKari Kakkonen
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityIES VE
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...Wes McKinney
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentPim van der Noll
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 

Recently uploaded (20)

The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI Age
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examples
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a reality
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 

Optimize Apache JMeter load testing with plugins

  • 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.