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?

Automation - Apache JMeter
Automation - Apache JMeterAutomation - Apache JMeter
Automation - Apache JMeterWira Santos
 
Spring camp 발표자료
Spring camp 발표자료Spring camp 발표자료
Spring camp 발표자료수홍 이
 
Basic of jMeter
Basic of jMeter Basic of jMeter
Basic of jMeter Shub
 
Apache Kafka - Event Sourcing, Monitoring, Librdkafka, Scaling & Partitioning
Apache Kafka - Event Sourcing, Monitoring, Librdkafka, Scaling & PartitioningApache Kafka - Event Sourcing, Monitoring, Librdkafka, Scaling & Partitioning
Apache Kafka - Event Sourcing, Monitoring, Librdkafka, Scaling & PartitioningGuido Schmutz
 
Prometheus - basics
Prometheus - basicsPrometheus - basics
Prometheus - basicsJuraj Hantak
 
Performance Testing
Performance TestingPerformance Testing
Performance Testingsharmaparish
 
Integration Testing with a Citrus twist
Integration Testing with a Citrus twistIntegration Testing with a Citrus twist
Integration Testing with a Citrus twistchristophd
 
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 JmeterPerformance Testing With Jmeter
Performance Testing With JmeterAdam Goucher
 
Performance testing with JMeter
Performance testing with JMeterPerformance testing with JMeter
Performance testing with JMeterMikael Kundert
 
Terraform 0.9 + good practices
Terraform 0.9 + good practicesTerraform 0.9 + good practices
Terraform 0.9 + good practicesRadek Simko
 
Performance testing with Jmeter
Performance testing with JmeterPerformance testing with Jmeter
Performance testing with JmeterPrashanth Kumar
 

Was ist angesagt? (20)

Automation - Apache JMeter
Automation - Apache JMeterAutomation - Apache JMeter
Automation - Apache JMeter
 
Spring camp 발표자료
Spring camp 발표자료Spring camp 발표자료
Spring camp 발표자료
 
Basic of jMeter
Basic of jMeter Basic of jMeter
Basic of jMeter
 
Apache Kafka - Event Sourcing, Monitoring, Librdkafka, Scaling & Partitioning
Apache Kafka - Event Sourcing, Monitoring, Librdkafka, Scaling & PartitioningApache Kafka - Event Sourcing, Monitoring, Librdkafka, Scaling & Partitioning
Apache Kafka - Event Sourcing, Monitoring, Librdkafka, Scaling & Partitioning
 
Prometheus - basics
Prometheus - basicsPrometheus - basics
Prometheus - basics
 
Performance Testing
Performance TestingPerformance Testing
Performance Testing
 
JMeter Intro
JMeter IntroJMeter Intro
JMeter Intro
 
Maven Overview
Maven OverviewMaven Overview
Maven Overview
 
Integration Testing with a Citrus twist
Integration Testing with a Citrus twistIntegration Testing with a Citrus twist
Integration Testing with a Citrus twist
 
Jmeter tool
Jmeter toolJmeter tool
Jmeter tool
 
Apache JMeter - A brief introduction
Apache JMeter - A brief introductionApache JMeter - A brief introduction
Apache JMeter - A brief introduction
 
Cucumber ppt
Cucumber pptCucumber ppt
Cucumber ppt
 
Performance Testing With Jmeter
Performance Testing With JmeterPerformance Testing With Jmeter
Performance Testing With Jmeter
 
J Meter Intro
J Meter IntroJ Meter Intro
J Meter Intro
 
Performance testing with JMeter
Performance testing with JMeterPerformance testing with JMeter
Performance testing with JMeter
 
Maven Introduction
Maven IntroductionMaven Introduction
Maven Introduction
 
Terraform 0.9 + good practices
Terraform 0.9 + good practicesTerraform 0.9 + good practices
Terraform 0.9 + good practices
 
Soap vs rest
Soap vs restSoap vs rest
Soap vs rest
 
Performance testing with Jmeter
Performance testing with JmeterPerformance testing with Jmeter
Performance testing with Jmeter
 
Jmeter From Scratch
Jmeter From ScratchJmeter From Scratch
Jmeter From Scratch
 

Ähnlich wie 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
 

Ähnlich wie 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
 

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

Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
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
 
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
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
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
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 

Kürzlich hochgeladen (20)

Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
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
 
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
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
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
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 

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.