SlideShare a Scribd company logo
1 of 15
Platinum Sponsor
Community
Gold Sponsor
Automate your load testing using Azure
DevOps, K6 and Log Analytics
Ivan Porta
@GTRekter
Session subtitle
Tommaso Stocchi
@tommasodotNET
A test for every taste
Load
testing
Performance
testing
Stress
testing
Capacity
planning
How fast will
the application
code perform?
How will the
application
behave in front of
the expected
users load?
What is point of
users-load that
will break your
application?
Will the
application
be able to scale
up to the
expected
future capacity?
Why load Testing?
Why load Testing?
How do load testing work?
How does load testing work?
Load test with k6
• Open source.
• k6 is an open-source load testing tool written in Golang that
embeds a JavaScript runtime.
• It can run a huge amount of traffic on a single computer,
reducing the need for complex distributed testing infrastructure.
• Already dockerized.
• Support both scripting in ES6 JS and protocols like HTTP/1.1,
HTTP/2, WebSocket and gRPC.
• Very easy to integrate into CI/CD
Why k6?
Number of developers using
JavaScript worldwide
12.4M
Most used languages among software developers globally 2021
Sources: Statista.com, SlashData
21.98
48.24
27.86
35.35
21.01
64.96
PHP PYTHON C# JAVA C JAVASCRIPT
Number of libraries
1.4M
Average cost of reskilling per
person
$24.8K
Why k6?
11 31
162
244
38 56
478
330
112 114
661
402
0
200
400
600
800
Hey k6 Jmeter Catling
Memory
Usage
(MB)
Memory usage per request volume
20k reqs 300k reqs 1M reqs
18100
11300
7000
4700
98 67 533 363
0
5000
10000
15000
20000
Hey k6 Jmeter Catling
Requests/second
Max RPS rates / Memory usage
Max RPS Memory usage (MB)
• K6 is Code-driven; it gives you huge flexibility
when writing your tests
• Can run a huge amount of traffic on a single
computer.
• Utilizes very less resources from the system
compared to other tools.
• Being able to execute your test from a single
machine makes running k6 through your CI
pipeline a lot more straightforward, as you don’t
have to setup additional injectors.
• If you can extract more load out of one machine, it
is easier for developer to run the same CI/CD bits
locally.
Setting up k6
macOS
Windows
Docker
Linux
$ brew install k6
choco install k6
$ docker pull loadimpact/k6
$ sudo apt-key adv --keyserver
hkp://keyserver.ubuntu.com:80 --recv-keys
C5AD17C747E3415A3642D57D77C6C491D6AC1D69
$ sudo apt-get update
$ sudo apt-get install k6
DEMO
Q&A
Platinum Sponsor
Community
Gold Sponsor

More Related Content

Similar to Automate your load testing using Azure DevOps, K6 and Log Analytics

The Next Leap in JavaScript Performance
The Next Leap in JavaScript PerformanceThe Next Leap in JavaScript Performance
The Next Leap in JavaScript PerformanceIntel® Software
 
JITServerTalk JCON World 2023.pdf
JITServerTalk JCON World 2023.pdfJITServerTalk JCON World 2023.pdf
JITServerTalk JCON World 2023.pdfRichHagarty
 
Containerizing GPU Applications with Docker for Scaling to the Cloud
Containerizing GPU Applications with Docker for Scaling to the CloudContainerizing GPU Applications with Docker for Scaling to the Cloud
Containerizing GPU Applications with Docker for Scaling to the CloudSubbu Rama
 
OpenEBS hangout #4
OpenEBS hangout #4OpenEBS hangout #4
OpenEBS hangout #4OpenEBS
 
Cognos Performance Tuning Tips & Tricks
Cognos Performance Tuning Tips & TricksCognos Performance Tuning Tips & Tricks
Cognos Performance Tuning Tips & TricksSenturus
 
Introduction to Apache Mesos and DC/OS
Introduction to Apache Mesos and DC/OSIntroduction to Apache Mesos and DC/OS
Introduction to Apache Mesos and DC/OSSteve Wong
 
Understand the Trade-offs Using Compilers for Java Applications
Understand the Trade-offs Using Compilers for Java ApplicationsUnderstand the Trade-offs Using Compilers for Java Applications
Understand the Trade-offs Using Compilers for Java ApplicationsC4Media
 
ChakraCore - JSConf Last Call
ChakraCore - JSConf Last CallChakraCore - JSConf Last Call
ChakraCore - JSConf Last CallGaurav Seth
 
Latest (storage IO) patterns for cloud-native applications
Latest (storage IO) patterns for cloud-native applications Latest (storage IO) patterns for cloud-native applications
Latest (storage IO) patterns for cloud-native applications OpenEBS
 
WebSphere App Server vs JBoss vs WebLogic vs Tomcat (InterConnect 2016)
WebSphere App Server vs JBoss vs WebLogic vs Tomcat (InterConnect 2016)WebSphere App Server vs JBoss vs WebLogic vs Tomcat (InterConnect 2016)
WebSphere App Server vs JBoss vs WebLogic vs Tomcat (InterConnect 2016)Roman Kharkovski
 
Ceph Day Taipei - Accelerate Ceph via SPDK
Ceph Day Taipei - Accelerate Ceph via SPDK Ceph Day Taipei - Accelerate Ceph via SPDK
Ceph Day Taipei - Accelerate Ceph via SPDK Ceph Community
 
OpenPOWER Acceleration of HPCC Systems
OpenPOWER Acceleration of HPCC SystemsOpenPOWER Acceleration of HPCC Systems
OpenPOWER Acceleration of HPCC SystemsHPCC Systems
 
Building FoundationDB
Building FoundationDBBuilding FoundationDB
Building FoundationDBFoundationDB
 
Kubernetes Forum Seoul 2019: Re-architecting Data Platform with Kubernetes
Kubernetes Forum Seoul 2019: Re-architecting Data Platform with KubernetesKubernetes Forum Seoul 2019: Re-architecting Data Platform with Kubernetes
Kubernetes Forum Seoul 2019: Re-architecting Data Platform with KubernetesSeungYong Oh
 
모바일 트렌드와 iOS
모바일 트렌드와 iOS모바일 트렌드와 iOS
모바일 트렌드와 iOSJung Kim
 
SaltConf14 - Eric johnson, Google - Orchestrating Google Compute Engine with ...
SaltConf14 - Eric johnson, Google - Orchestrating Google Compute Engine with ...SaltConf14 - Eric johnson, Google - Orchestrating Google Compute Engine with ...
SaltConf14 - Eric johnson, Google - Orchestrating Google Compute Engine with ...SaltStack
 
Tampere Docker meetup - Happy 5th Birthday Docker
Tampere Docker meetup - Happy 5th Birthday DockerTampere Docker meetup - Happy 5th Birthday Docker
Tampere Docker meetup - Happy 5th Birthday DockerSakari Hoisko
 
Red Hat Java Update and Quarkus Introduction
Red Hat Java Update and Quarkus IntroductionRed Hat Java Update and Quarkus Introduction
Red Hat Java Update and Quarkus IntroductionJohn Archer
 

Similar to Automate your load testing using Azure DevOps, K6 and Log Analytics (20)

The Next Leap in JavaScript Performance
The Next Leap in JavaScript PerformanceThe Next Leap in JavaScript Performance
The Next Leap in JavaScript Performance
 
JITServerTalk JCON World 2023.pdf
JITServerTalk JCON World 2023.pdfJITServerTalk JCON World 2023.pdf
JITServerTalk JCON World 2023.pdf
 
Containerizing GPU Applications with Docker for Scaling to the Cloud
Containerizing GPU Applications with Docker for Scaling to the CloudContainerizing GPU Applications with Docker for Scaling to the Cloud
Containerizing GPU Applications with Docker for Scaling to the Cloud
 
OpenEBS hangout #4
OpenEBS hangout #4OpenEBS hangout #4
OpenEBS hangout #4
 
Cognos Performance Tuning Tips & Tricks
Cognos Performance Tuning Tips & TricksCognos Performance Tuning Tips & Tricks
Cognos Performance Tuning Tips & Tricks
 
Introduction to Apache Mesos and DC/OS
Introduction to Apache Mesos and DC/OSIntroduction to Apache Mesos and DC/OS
Introduction to Apache Mesos and DC/OS
 
Understand the Trade-offs Using Compilers for Java Applications
Understand the Trade-offs Using Compilers for Java ApplicationsUnderstand the Trade-offs Using Compilers for Java Applications
Understand the Trade-offs Using Compilers for Java Applications
 
All in one
All in oneAll in one
All in one
 
ChakraCore - JSConf Last Call
ChakraCore - JSConf Last CallChakraCore - JSConf Last Call
ChakraCore - JSConf Last Call
 
Latest (storage IO) patterns for cloud-native applications
Latest (storage IO) patterns for cloud-native applications Latest (storage IO) patterns for cloud-native applications
Latest (storage IO) patterns for cloud-native applications
 
WebSphere App Server vs JBoss vs WebLogic vs Tomcat (InterConnect 2016)
WebSphere App Server vs JBoss vs WebLogic vs Tomcat (InterConnect 2016)WebSphere App Server vs JBoss vs WebLogic vs Tomcat (InterConnect 2016)
WebSphere App Server vs JBoss vs WebLogic vs Tomcat (InterConnect 2016)
 
Ceph Day Taipei - Accelerate Ceph via SPDK
Ceph Day Taipei - Accelerate Ceph via SPDK Ceph Day Taipei - Accelerate Ceph via SPDK
Ceph Day Taipei - Accelerate Ceph via SPDK
 
OpenPOWER Acceleration of HPCC Systems
OpenPOWER Acceleration of HPCC SystemsOpenPOWER Acceleration of HPCC Systems
OpenPOWER Acceleration of HPCC Systems
 
Building FoundationDB
Building FoundationDBBuilding FoundationDB
Building FoundationDB
 
Kubernetes Forum Seoul 2019: Re-architecting Data Platform with Kubernetes
Kubernetes Forum Seoul 2019: Re-architecting Data Platform with KubernetesKubernetes Forum Seoul 2019: Re-architecting Data Platform with Kubernetes
Kubernetes Forum Seoul 2019: Re-architecting Data Platform with Kubernetes
 
모바일 트렌드와 iOS
모바일 트렌드와 iOS모바일 트렌드와 iOS
모바일 트렌드와 iOS
 
SaltConf14 - Eric johnson, Google - Orchestrating Google Compute Engine with ...
SaltConf14 - Eric johnson, Google - Orchestrating Google Compute Engine with ...SaltConf14 - Eric johnson, Google - Orchestrating Google Compute Engine with ...
SaltConf14 - Eric johnson, Google - Orchestrating Google Compute Engine with ...
 
Tampere Docker meetup - Happy 5th Birthday Docker
Tampere Docker meetup - Happy 5th Birthday DockerTampere Docker meetup - Happy 5th Birthday Docker
Tampere Docker meetup - Happy 5th Birthday Docker
 
Liberty Deep Dive
Liberty Deep DiveLiberty Deep Dive
Liberty Deep Dive
 
Red Hat Java Update and Quarkus Introduction
Red Hat Java Update and Quarkus IntroductionRed Hat Java Update and Quarkus Introduction
Red Hat Java Update and Quarkus Introduction
 

Recently uploaded

"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments""Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"mphochane1998
 
Block diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.pptBlock diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.pptNANDHAKUMARA10
 
+97470301568>> buy weed in qatar,buy thc oil qatar,buy weed and vape oil in d...
+97470301568>> buy weed in qatar,buy thc oil qatar,buy weed and vape oil in d...+97470301568>> buy weed in qatar,buy thc oil qatar,buy weed and vape oil in d...
+97470301568>> buy weed in qatar,buy thc oil qatar,buy weed and vape oil in d...Health
 
Employee leave management system project.
Employee leave management system project.Employee leave management system project.
Employee leave management system project.Kamal Acharya
 
School management system project Report.pdf
School management system project Report.pdfSchool management system project Report.pdf
School management system project Report.pdfKamal Acharya
 
DeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakesDeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakesMayuraD1
 
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptxS1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptxSCMS School of Architecture
 
Computer Networks Basics of Network Devices
Computer Networks  Basics of Network DevicesComputer Networks  Basics of Network Devices
Computer Networks Basics of Network DevicesChandrakantDivate1
 
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptxHOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptxSCMS School of Architecture
 
Air Compressor reciprocating single stage
Air Compressor reciprocating single stageAir Compressor reciprocating single stage
Air Compressor reciprocating single stageAbc194748
 
notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptMsecMca
 
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best ServiceTamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Servicemeghakumariji156
 
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills KuwaitKuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwaitjaanualu31
 
Learn the concepts of Thermodynamics on Magic Marks
Learn the concepts of Thermodynamics on Magic MarksLearn the concepts of Thermodynamics on Magic Marks
Learn the concepts of Thermodynamics on Magic MarksMagic Marks
 
A Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityA Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityMorshed Ahmed Rahath
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayEpec Engineered Technologies
 
DC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equationDC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equationBhangaleSonal
 
Hostel management system project report..pdf
Hostel management system project report..pdfHostel management system project report..pdf
Hostel management system project report..pdfKamal Acharya
 
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...Call Girls Mumbai
 

Recently uploaded (20)

"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments""Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
 
Block diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.pptBlock diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.ppt
 
+97470301568>> buy weed in qatar,buy thc oil qatar,buy weed and vape oil in d...
+97470301568>> buy weed in qatar,buy thc oil qatar,buy weed and vape oil in d...+97470301568>> buy weed in qatar,buy thc oil qatar,buy weed and vape oil in d...
+97470301568>> buy weed in qatar,buy thc oil qatar,buy weed and vape oil in d...
 
Employee leave management system project.
Employee leave management system project.Employee leave management system project.
Employee leave management system project.
 
School management system project Report.pdf
School management system project Report.pdfSchool management system project Report.pdf
School management system project Report.pdf
 
DeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakesDeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakes
 
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptxS1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
 
Computer Networks Basics of Network Devices
Computer Networks  Basics of Network DevicesComputer Networks  Basics of Network Devices
Computer Networks Basics of Network Devices
 
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptxHOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
 
Air Compressor reciprocating single stage
Air Compressor reciprocating single stageAir Compressor reciprocating single stage
Air Compressor reciprocating single stage
 
notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.ppt
 
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best ServiceTamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
 
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills KuwaitKuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
 
Learn the concepts of Thermodynamics on Magic Marks
Learn the concepts of Thermodynamics on Magic MarksLearn the concepts of Thermodynamics on Magic Marks
Learn the concepts of Thermodynamics on Magic Marks
 
A Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityA Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna Municipality
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
 
DC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equationDC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equation
 
Hostel management system project report..pdf
Hostel management system project report..pdfHostel management system project report..pdf
Hostel management system project report..pdf
 
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
 
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak HamilCara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
 

Automate your load testing using Azure DevOps, K6 and Log Analytics

  • 2. Automate your load testing using Azure DevOps, K6 and Log Analytics Ivan Porta @GTRekter Session subtitle Tommaso Stocchi @tommasodotNET
  • 3. A test for every taste Load testing Performance testing Stress testing Capacity planning How fast will the application code perform? How will the application behave in front of the expected users load? What is point of users-load that will break your application? Will the application be able to scale up to the expected future capacity?
  • 6. How do load testing work?
  • 7. How does load testing work?
  • 8. Load test with k6 • Open source. • k6 is an open-source load testing tool written in Golang that embeds a JavaScript runtime. • It can run a huge amount of traffic on a single computer, reducing the need for complex distributed testing infrastructure. • Already dockerized. • Support both scripting in ES6 JS and protocols like HTTP/1.1, HTTP/2, WebSocket and gRPC. • Very easy to integrate into CI/CD
  • 9. Why k6? Number of developers using JavaScript worldwide 12.4M Most used languages among software developers globally 2021 Sources: Statista.com, SlashData 21.98 48.24 27.86 35.35 21.01 64.96 PHP PYTHON C# JAVA C JAVASCRIPT Number of libraries 1.4M Average cost of reskilling per person $24.8K
  • 10. Why k6? 11 31 162 244 38 56 478 330 112 114 661 402 0 200 400 600 800 Hey k6 Jmeter Catling Memory Usage (MB) Memory usage per request volume 20k reqs 300k reqs 1M reqs 18100 11300 7000 4700 98 67 533 363 0 5000 10000 15000 20000 Hey k6 Jmeter Catling Requests/second Max RPS rates / Memory usage Max RPS Memory usage (MB) • K6 is Code-driven; it gives you huge flexibility when writing your tests • Can run a huge amount of traffic on a single computer. • Utilizes very less resources from the system compared to other tools. • Being able to execute your test from a single machine makes running k6 through your CI pipeline a lot more straightforward, as you don’t have to setup additional injectors. • If you can extract more load out of one machine, it is easier for developer to run the same CI/CD bits locally.
  • 11. Setting up k6 macOS Windows Docker Linux $ brew install k6 choco install k6 $ docker pull loadimpact/k6 $ sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys C5AD17C747E3415A3642D57D77C6C491D6AC1D69 $ sudo apt-get update $ sudo apt-get install k6
  • 12. DEMO
  • 13.
  • 14. Q&A

Editor's Notes

  1. Good morning everyone Before we start, I just want to thanks our sponsor that made this event possible
  2. My name is Ivan Porta, I’m a customer engineer at Microsoft and today I’m here with my collegue Tommaso Stocchi to talk about how to Automate your load testing using Azure DevOps, K6 and Log Analytics If you have any question,just pop us a tweet or a message and we will try to answer asap.
  3. So, When we develop an application there are many things that we have to keep in considerations, for example: How fast will the application code perform? How will the application behave in front of an expected users load? What is point of users-load that actually will break the application? Will the application be able to scale up to the expected future capacity? And each one of these question have a specific test or activity that aim to give you the information you need to answer and be sure that you are delivering a good quality software. For example, Performance testing: focuses on the performance of your source code Load testing: focuses on the application’s stability and reliability under both normal and peak load conditions. Stress testing: focuses on reaching the breaking point of your application by putting the application under unrealistic loads While load testing tests your application under realistic average or peak loads, stress testing tests it under conditions that far exceed realistic estimates. Capacity planning: Focus on verify that the application will scale up to the future capacity. In today’s session we are going to focus on load testing. The second block.
  4. So why is load testing important? If you live in the United States probably this is the last thing that you would like to see. When 2010, the government of the United State rolled out of the Obamacare individual mandate, thousands and thousands of people rushed to the website to enroll the health program. As result the system which development’s cost was estimated over $600 million crushed and the entire Healthcare.gov website went down making impossible to the users to login and enroll. The government started an investigation and there were claims that: the code for the website was poorly written never tested Used an outdated technology The HHS Secretary Kathleen Sebelius was also called to testify in front of a Congress to explain what has happened. Obamacare website goes down for repairs - CBS News President Obama Addresses Healthcare Website Problems - Guardian Liberty Voice (guardianlv.com) Retooled Obamacare website traffic surges but problems remain (yahoo.com)
  5. For those of you who don’t have to deal with the American health care system or likes colorful graphs, this slide might be more interesting. In today’s world, both enterprises and consumers rely on digital applications for crucial functions. For this reason, even a small failure can be costly both in terms of reputation and money. For example, imagine if Amazon did not know the amount of traffic that its servers could sustain; it would fail to supply requests from its customer during peak seasons like Black Friday. You might think that this event is unlikely. However, according to a survey taken by Gartner (a global research and advisory firm), in 2020, 25% of respondents reported the average hourly downtime cost of their application was between $301,000 and $400,000. Furthermore, 17% said it cost them $5M per hour. Global hourly enterprise server downtime cost 2019 | Statista
  6. How do load testing work? On one had we have your developers. They write the actual tests that the tool is going to perform. Then you start the test by clicking a button on a UI or executing a command on your command prompt The tool will simulate a specific number of virtual users (might be hundreds or even millions) by sending concurrent requests to your target machine and measuring insights like: response times, throughput rates, resource utilization levels, and more. Once the tests is over, the tool will then create a summary showing these metrics It’s important to understand that the number of virtual user’s should be a realistic number (this is one of the main differences from stress tests). For example, according to your analysis you expect 100k users on your ecommerce on Christmas with random peeks around 200k.
  7. At the end you will have some metrics like these (depending on the tool that you are using).
  8. Now that we know why load testing are important and how they work, let’s move into some tools….in particular k6. k6 is an open-source load testing tool written in Go that embeds a JavaScript runtime to allow developers to write performance tests in JavaScript. By default, can connect and talk to the target server over TLS It’s docker friendly Support HTTP/1.1, HTTP/2, WebSocket and gRPC protocols It’s also support checks and thresholds for easy and flexible CI configuration! Last but not least, In June 2021 k6 also became part of Grafana Labs. With offers a flexible metrics storage and visualization: InfluxDB (+Grafana), JSON or k6 Cloud https://grafana.com/ https://github.com/grafana/k6
  9. As ai mentioned in the previous slide there are many load testing tools out there, for example: Jmeter, Locust, Fiddler, nGrinder, Gatling So why are we here today talking about k6? According to a survey taken by Statista.com on which programming language was most commonly used by software developers around the world, we can see that.. As of 2021 JavaScript is the most commonly used programming languages among software developers, with nearly 65 percent of respondents stating that they used JavaScript. It’s can boast more that 1.4 Million libraries According to a survey taken by SlashData, JavaScript, CoffeeScript and Microsoft's TypeScript, reached around 12.4 million developers worldwide. You might say, even if my dev team are not familiar with javascript, well they can learn a new programming language? What’s the big deal? According to a 2019 paper from the World Economic Forum. The cost of reskilling in the United States — which includes funding learning design, training materials and subject matter expertise — is approximately $24,800 per person. This is only for the training, you have to consider the time this person in not actually working https://www.javascript.com/ https://www.statista.com/statistics/793628/worldwide-developer-survey-most-used-languages/ https://www.slashdata.co/free-resources/developer-economics-state-of-the-developer-nation-19th-edition https://www.benefitnews.com/list/cost-effective-ways-to-upskill-and-reskill-employees
  10. Load testing can be tricky because, especially with large-scale tests with thousands or even millions of virtual users (just think about websites like amazon or well…Facebook when was still up and running). As mentioned earlier these virtual users that later will generate traffic to your application are generated from a machine and like every machine it need RAM and CPU. The problem here is that as the number of VU increase, you machine might suffer from a lack of computational power. As result, you may either see that: your load test becomes unable to go above a certain number of requests per second or you may see that response time measurements become completely unreliable.  To solve this problem, you can scale vertically or horizontally your VM, but another option is to use a tool that is less hungry of resources like k6. By doing so: Not only you will save money (don’t have to scale your VM) But also, you will make it easier to your developers to integrate it with your CI/CD. In this graphs you can see some measurements takes with a Machine in the load generation side: 4-core Celeron server running Ubuntu 18.04 with 8GB RAM Target machine with a simple Nginx server: 4Ghz i7 iMac with 16G RAM with some a Google spreadsheet open in a browser, but made sure nothing demanding was happening while tests were running. I usually fire up an Nginx server and then I load test by fetching the default "Welcome to Nginx" page. How many requests per second could each tool generate in this lab setup? Here working with most parameters available, but primarily concurrence (how many threads the tool used, and how many TCP connections) and things like enabling HTTP keep-alive, disabling things the tool did that required lots of CPU (HTML parsing maybe), etc. The goal was to cram out as many requests per second out of each tool as possible. Several of the tools are quite memory-hungry and sometimes memory usage is also dependent on the size of the test, in terms of virtual users (VUs). High memory usage per VU can prevent people from running large-scale tests using the tool. Thanks to the usage of Gorourines offered by Go, a single instance of k6 is often enough to generate load of 30.000-40.000 simultaneous users (VUs). This amount of VUs can generate upwards of 300,000 requests per second (RPS). Unless you need more than 100,000-300,000 requests per second (6-12M requests per minute), a single instance of k6 will likely be sufficient for your needs. https://k6.io/docs/testing-guides/running-large-tests/ https://k6.io/blog/comparing-best-open-source-load-testing-tools/#memory-usage-per-vu-level
  11. Before leaving the stage to Tommaso I just want to give you a quick side note on how easy is to install k6. With just one or few lines of code you can setup the tool on your local machine. With this I have finished, Tommaso the stage is yours.