SlideShare una empresa de Scribd logo
1 de 45
Descargar para leer sin conexión
Laravel Load Testing:
Strategies and Tools
Muhammad Shehata
SWE @RobustaStudio
Non-functional Testing
Performance Testing
K6 by Grafana Labs
Load Testing
Non-functional
Testing
01
Non-Functional
Tests the readiness of a system as per
nonfunctional parameters which are not
covered by functional testing. We conduct
non-functional testing to make sure that
users expectations are met.
Testing
Functional
Functional testing verifies that a program is
operating according to the technical and business
requirements. Functional testers main concern is
checking the functionality.
Testing
Functional Testing
Tests what a product does
Either present or not present
Validated against requirements
Requirements are easy to specify
Non-functional Testing
Tests how a product works
Evaluated on a scale
Validated against end-user expectations
Requirements are hard to specify
Functional
Testing
Unit
Testing
Integration
Testing
System
Testing
Acceptance
Testing
Non-functional
Testing
Performance
Testing
Security
Testing
Usability
Testing
Compatibility
Testing
Performance
Testing
02
Why Use Performance
Testing?
• Performance testing can be used as a diagnostic
aid to locate computing or communications
bottlenecks within a system.
• Performance testing can also verify that a system
meets the specifications claimed by its
manufacturer or vendor..
Performance Testing
Performance Testing
Metrics
Processor Usage.
Amount of time processor
spends executing non-idle
threads
Memory Use.
Amount of physical memory
available to processes on a
computer.
Disk Time.
Amount of time disk is busy
executing a read or write
request.
Performance Testing
Metrics
Bandwidth.
shows the bits per second
used by a network interface.
Response Time.
time from when a user
enters a request until the
first character of the
response is received.
Throughput.
rate a computer or network
receives requests per
second.
Performance Testing
Metrics
Hit Ratio.
The number of SQL
statements that are handled
by cached data instead of
expensive I/O operations.
Database Locks.
Monitoring locking of tables
and databases to be
carefully tuned.
Max. Active Sessions.
The maximum number of
sessions that can be active
at once.
Types of Performance Testing
Performance Testing
Load Testing
• Checks the application’s ability to perform under anticipated
user loads. The objective is to identify performance bottlenecks
before the software application goes live.
Stress Testing
• Involves testing an application under extreme workloads to see
how it handles high traffic or data processing. The objective is to
identify the breaking point of an application.
Endurance Testing
• Is done to make sure the software can handle the expected load
over a long period of time.
Spike Testing
• Tests the software’s reaction to sudden large spikes in the load
generated by users.
Volume Testing
• Under Volume Testing large no. of. Data is populated in a database
and the overall software system’s behavior is monitored. The objective
is to check software application’s performance under varying database
volumes.
Scalability Testing
• The objective of scalability testing is to determine the software
application’s effectiveness in “scaling up” to support an increase in
user load. It helps plan capacity addition to your software system.
Load Testing
03
Load Testing Goals
LOAD TESTING
• Response time for each request
• Performance of the system components under
different loads
• Performance of database components under
different loads
• Network delay between the client and the server
• Software design issues
• Server configuration issues like a web server,
application server, database server etc.
• Hardware limitation issues like CPU
maximization, memory limitations, network
bottleneck, etc.
01
Architecture Validation
Takes place early in the development
after a prototype of the app is created.
This guarantees the viability of the
selected architectural framework.
02
Performance Benchmarking
Sets and creates the benchmark tests for
the initial version of the app.
Gives the Eng. and the QA groups a set
of metrics to quantify the scalability.
Dev. team will either maintain metrics or
improve upon it through the subsequent
milestones.
03
Performance Regression.
Ensures that the changes made to the
app do not result in degradation of
performance.
Executed when key milestones have been
reached or architectural modifications
have been made.
Load Testing
Phases
LOAD TESTING
04
Acceptance and Tuning
The final load testing phase prior to the
official launch.
Different scenarios of real-life usage are
emulated and the performance of the
final configuration is validated.
These scenarios are also used to
configure the HW and SW components
to yield optimal performance.
05
Performance Monitoring
After the app is deployed, it is essential
to monitor the performance of the
system so that crashes or slow-downs
can be spotted before they become
problematic.
Data related to real life usage can be
collected to help refine future tests for
accurate emulation of load.
Load Testing
Phases
LOAD TESTING
Load Testing
Criteria
• Produce load that stresses all layers of a multi-layer app.
• Allow for the emulation of a realistic mix of different groups
performing different types of business transaction on the
app during peak periods.
• Emulate page and resource request patterns.
• Validate the responses coming back from the web server for
each of the thousands of concurrent users to ensure that
the correct pages are being returned by the Web
application under stress.
LOAD TESTING
Load Testing
Criteria
• Allow for easy maintenance of the scripts testing script.
• Dynamic Dial-up of users - this capability allows you to add
new users to the load test without stopping the current test.
• Real-Time Virtual User Debugger: the load testing tool
should have some capability to allow you to visually monitor
the progress of a user at any given point in time.
• Real-Time Graphs that allow you to understand the
scalability characteristics of the application as the load test
is in progress.
LOAD TESTING
Load Testing
Criteria
• Allow for distributing load tests from a number of machines.
• Allow the load tests to be executed with recorded think
times, random think times (following some kind of
statistical distribution), and with no think times.
• Measure response times of entire business transactions in
addition to individual objects.
• Allow for simulation of different types of caching behaviors.
• Allow for complex scheduling to allow for different
scenarios of starting, stopping, and ramp-up.
LOAD TESTING
K6 Testing Tool
04
What is K6
K6 Testing Tool
• K6 is an open source load testing tool that
is developed by Grafana Labs and the
community.
• CLI tool with developer-friendly APIs.
• Test scripting is done in JavaScript
ES2015/ES6.
• The tool itself is written in Go to achieve
maximum performance.
How to Install
K6 Testing Tool
It can be installed on Linux, MacOS,
Windows and of course Docker
Running the First Test
K6 Testing Tool
Scenario
A scenario load test is for testing a real-world
flow of interactions, e.g.. a user logging in,
starting some activity, waiting for progress,
and then logging out. The goal here is to test
the target system with traffic that is
consistent with what you’d see in the real
world in terms of URLs/endpoints being hit.
Load Testing
Unit
A unit load test is testing a single unit, like an API
endpoint, in isolation. You might primarily be
interested in how the endpoint’s performance
trends over time, and be alerted to performance
regressions.
Load Testing
Test Life Cycle
Init
Setup
VU
Teardown
K6 Testing Tool
Test Life Cycle: Init and VU
 The bare minimum for any test is to have default
function. Which act as the entry point for the VU.
 Code inside default is called "VU code", and is run as
long as the test is running. Code outside of it is called
"init code", and is run only once per VU.
 You can't load anything from your local filesystem, or
import any other modules. This all has to be done from
the init code.
 You can use this to reuse data between iterations (but
only for the same VU).
K6 Testing Tool
Test Life Cycle: Setup and
Teardown
 setup and teardown are only called once for a test.
 function signature of the default function and
teardown function can take an argument, This
argument will be whatever is returned in the setup
function.
 Any requests made in the setup and teardown stages
will be counted in the end-of-test summary. Those
requests will be tagged appropriately with the ::setup
and ::teardown
K6 Testing Tool
HTTP Requests
K6 Testing Tool
• The first step of creating a load test is
defining HTTP request.
• K6 HTTP module support all HTTP
methods
Test Results
K6 Testing Tool
• Metrics
• Checks
• Thresholds
• Results Output
Test Results: Metric Types
K6 Testing Tool
• A metric that cumulatively
sums added values.
Counter
• Best used to show a range,
it stores the min, max and
last values added to it.
Gauge
• A metric that tracks the
percentage of values, in our
case it will be non-zero
values
Rate
• A pattern found in time
series datasets; used to
describe data movement
either upward or downward.
Trend
Test Results: Built-in Metrics
K6 Testing Tool
{
Test Results: Custom
Metrics
K6 Testing Tool
• K6 allows you to create custom metrics
of any type.
• Custom Metrics are reported at the end
of the test.
Test Results: Custom
Metrics
K6 Testing Tool
Test Results: Checks
K6 Testing Tool
{
Test Results: Thresholds
K6 Testing Tool
• Thresholds are a pass/fail checks used to verify
that the expected performance is met.
Test Results: Thresholds
K6 Testing Tool
Metric Type Aggregation Method
Counter count and rate
Gauge value
Rate rate
Trend
avg, min, max, med
and p(N)
External Output
K6 Testing Tool
• The test summary provides a general
overview of your test results. By default,
the summary prints to stdout.
• K6 supports various built-in outputs
Virtual Users Ramping
K6 Testing Tool
Filtering Results
K6 Testing Tool
• Groups: organize your load script around
common business transaction.
• Tags: categorize your checks, thresholds,
custom metrics and requests with tags for
in-depth filtering.
Filtering Results: Groups
K6 Testing Tool
• Groups can be nested
• All metrics emitted in a group will have the
tag group with a value of all group names
wrapping it separated by '::' (two colons).
• The default/root group with the name ''
(empty string) which means that if you just
have a single group named 'cool
requests' the actual value of the group tag
will be ::cool requests
{
Filtering Results: Tags
K6 Testing Tool
K6 provides two types of tags:
• User-defined tags: the ones you've
added when writing your script.
• System tags: tags automatically assigned
by k6.
Filtering Results: Tags
K6 Testing Tool
K6 provides two types of tags:
• User-defined tags: the ones you've
added when writing your script.
• System tags: tags automatically assigned
by k6.
Scripts
K6 Testing Tool
• Multiple scenarios can be declared in the same
script, and each one can independently execute a
different JavaScript function.
• Every scenario can use a distinct VU and iteration
scheduling pattern.
• They can be configured to run in sequence or
parallel.
• Different environment variables and metric tags
can be set per scenario.
Scripts
K6 Testing Tool
• Multiple scenarios can be declared in the same
script, and each one can independently execute a
different JavaScript function.
• Every scenario can use a distinct VU and iteration
scheduling pattern.
• They can be configured to run in sequence or
parallel.
• Different environment variables and metric tags
can be set per scenario.
Thank You

Más contenido relacionado

La actualidad más candente

Disaster Recovery Plans for Apache Kafka
Disaster Recovery Plans for Apache KafkaDisaster Recovery Plans for Apache Kafka
Disaster Recovery Plans for Apache Kafkaconfluent
 
Everything You Need to Know About the 2019 DORA Accelerate State of DevOps Re...
Everything You Need to Know About the 2019 DORA Accelerate State of DevOps Re...Everything You Need to Know About the 2019 DORA Accelerate State of DevOps Re...
Everything You Need to Know About the 2019 DORA Accelerate State of DevOps Re...Red Gate Software
 
Elastic Observability keynote
Elastic Observability keynoteElastic Observability keynote
Elastic Observability keynoteElasticsearch
 
OSMC 2022 | OpenTelemetry 101 by Dotan Horovit s.pdf
OSMC 2022 | OpenTelemetry 101 by Dotan Horovit s.pdfOSMC 2022 | OpenTelemetry 101 by Dotan Horovit s.pdf
OSMC 2022 | OpenTelemetry 101 by Dotan Horovit s.pdfNETWAYS
 
CI and CD with Spinnaker
CI and CD with SpinnakerCI and CD with Spinnaker
CI and CD with SpinnakerVMware Tanzu
 
Monitoring at the Speed of DevOps
Monitoring at the Speed of DevOpsMonitoring at the Speed of DevOps
Monitoring at the Speed of DevOpsDevOps.com
 
How to Misuse and Abuse DORA Metrics.pptx
How to Misuse and Abuse DORA Metrics.pptxHow to Misuse and Abuse DORA Metrics.pptx
How to Misuse and Abuse DORA Metrics.pptxBryan Finster
 
What's an SRE at Criteo - Meetup SRE Paris
What's an SRE at Criteo - Meetup SRE ParisWhat's an SRE at Criteo - Meetup SRE Paris
What's an SRE at Criteo - Meetup SRE ParisClément Michaud
 
Devops Strategy Roadmap Lifecycle Ppt Powerpoint Presentation Slides Complete...
Devops Strategy Roadmap Lifecycle Ppt Powerpoint Presentation Slides Complete...Devops Strategy Roadmap Lifecycle Ppt Powerpoint Presentation Slides Complete...
Devops Strategy Roadmap Lifecycle Ppt Powerpoint Presentation Slides Complete...SlideTeam
 
Everything You wanted to Know About Distributed Tracing
Everything You wanted to Know About Distributed TracingEverything You wanted to Know About Distributed Tracing
Everything You wanted to Know About Distributed TracingAmuhinda Hungai
 
Building Microservices with Apache Kafka
Building Microservices with Apache KafkaBuilding Microservices with Apache Kafka
Building Microservices with Apache Kafkaconfluent
 
DevOps Maturity Curve v5
DevOps Maturity Curve v5DevOps Maturity Curve v5
DevOps Maturity Curve v5Paul Peissner
 
Event Driven Architecture: Mistakes, I've made a few...
Event Driven Architecture: Mistakes, I've made a few...Event Driven Architecture: Mistakes, I've made a few...
Event Driven Architecture: Mistakes, I've made a few...confluent
 
Nextcloud als On-Premises Lösung für hochsicheren Datenaustausch (Frank Karli...
Nextcloud als On-Premises Lösung für hochsicheren Datenaustausch (Frank Karli...Nextcloud als On-Premises Lösung für hochsicheren Datenaustausch (Frank Karli...
Nextcloud als On-Premises Lösung für hochsicheren Datenaustausch (Frank Karli...data://disrupted®
 
The Complete Guide to Service Mesh
The Complete Guide to Service MeshThe Complete Guide to Service Mesh
The Complete Guide to Service MeshAspen Mesh
 

La actualidad más candente (20)

Disaster Recovery Plans for Apache Kafka
Disaster Recovery Plans for Apache KafkaDisaster Recovery Plans for Apache Kafka
Disaster Recovery Plans for Apache Kafka
 
Everything You Need to Know About the 2019 DORA Accelerate State of DevOps Re...
Everything You Need to Know About the 2019 DORA Accelerate State of DevOps Re...Everything You Need to Know About the 2019 DORA Accelerate State of DevOps Re...
Everything You Need to Know About the 2019 DORA Accelerate State of DevOps Re...
 
Elastic Observability keynote
Elastic Observability keynoteElastic Observability keynote
Elastic Observability keynote
 
OSMC 2022 | OpenTelemetry 101 by Dotan Horovit s.pdf
OSMC 2022 | OpenTelemetry 101 by Dotan Horovit s.pdfOSMC 2022 | OpenTelemetry 101 by Dotan Horovit s.pdf
OSMC 2022 | OpenTelemetry 101 by Dotan Horovit s.pdf
 
CI and CD with Spinnaker
CI and CD with SpinnakerCI and CD with Spinnaker
CI and CD with Spinnaker
 
Monitoring at the Speed of DevOps
Monitoring at the Speed of DevOpsMonitoring at the Speed of DevOps
Monitoring at the Speed of DevOps
 
How to Misuse and Abuse DORA Metrics.pptx
How to Misuse and Abuse DORA Metrics.pptxHow to Misuse and Abuse DORA Metrics.pptx
How to Misuse and Abuse DORA Metrics.pptx
 
What's an SRE at Criteo - Meetup SRE Paris
What's an SRE at Criteo - Meetup SRE ParisWhat's an SRE at Criteo - Meetup SRE Paris
What's an SRE at Criteo - Meetup SRE Paris
 
Devops Strategy Roadmap Lifecycle Ppt Powerpoint Presentation Slides Complete...
Devops Strategy Roadmap Lifecycle Ppt Powerpoint Presentation Slides Complete...Devops Strategy Roadmap Lifecycle Ppt Powerpoint Presentation Slides Complete...
Devops Strategy Roadmap Lifecycle Ppt Powerpoint Presentation Slides Complete...
 
SRE & Kubernetes
SRE & KubernetesSRE & Kubernetes
SRE & Kubernetes
 
Everything You wanted to Know About Distributed Tracing
Everything You wanted to Know About Distributed TracingEverything You wanted to Know About Distributed Tracing
Everything You wanted to Know About Distributed Tracing
 
Service mesh
Service meshService mesh
Service mesh
 
Building Microservices with Apache Kafka
Building Microservices with Apache KafkaBuilding Microservices with Apache Kafka
Building Microservices with Apache Kafka
 
DevOps Maturity Curve v5
DevOps Maturity Curve v5DevOps Maturity Curve v5
DevOps Maturity Curve v5
 
Event Driven Architecture: Mistakes, I've made a few...
Event Driven Architecture: Mistakes, I've made a few...Event Driven Architecture: Mistakes, I've made a few...
Event Driven Architecture: Mistakes, I've made a few...
 
Introduction to Docker on AWS
Introduction to Docker on AWSIntroduction to Docker on AWS
Introduction to Docker on AWS
 
Nextcloud als On-Premises Lösung für hochsicheren Datenaustausch (Frank Karli...
Nextcloud als On-Premises Lösung für hochsicheren Datenaustausch (Frank Karli...Nextcloud als On-Premises Lösung für hochsicheren Datenaustausch (Frank Karli...
Nextcloud als On-Premises Lösung für hochsicheren Datenaustausch (Frank Karli...
 
Devops architecture
Devops architectureDevops architecture
Devops architecture
 
The Complete Guide to Service Mesh
The Complete Guide to Service MeshThe Complete Guide to Service Mesh
The Complete Guide to Service Mesh
 
5 benefits of OpManager
5 benefits of OpManager5 benefits of OpManager
5 benefits of OpManager
 

Similar a Laravel Load Testing: Strategies and Tools

Load and performance testing
Load and performance testingLoad and performance testing
Load and performance testingQualitest
 
What is Performance Testing?
What is Performance Testing?What is Performance Testing?
What is Performance Testing?QA InfoTech
 
HP LoadRunner
HP LoadRunnerHP LoadRunner
HP LoadRunnerFayis-QA
 
Automation Tool Overview
Automation Tool OverviewAutomation Tool Overview
Automation Tool OverviewANKUR-BA
 
Automation Tools Overview
Automation Tools OverviewAutomation Tools Overview
Automation Tools OverviewSachin-QA
 
Performancetestingjmeter 121109061704-phpapp02
Performancetestingjmeter 121109061704-phpapp02Performancetestingjmeter 121109061704-phpapp02
Performancetestingjmeter 121109061704-phpapp02Shivakumara .
 
Software Testing includes Performance testing with Load Runner and the JMeter
Software Testing includes Performance testing with Load Runner and the JMeter Software Testing includes Performance testing with Load Runner and the JMeter
Software Testing includes Performance testing with Load Runner and the JMeter Hima Bindu Kosuru
 
Automation Tools Overview
Automation Tools OverviewAutomation Tools Overview
Automation Tools OverviewMurageppa-QA
 
Performance testing jmeter
Performance testing jmeterPerformance testing jmeter
Performance testing jmeterBhojan Rajan
 
Introduction to performance testing
Introduction to performance testingIntroduction to performance testing
Introduction to performance testingRichard Bishop
 
" Performance testing for Automation QA - why and how " by Andrey Kovalenko f...
" Performance testing for Automation QA - why and how " by Andrey Kovalenko f..." Performance testing for Automation QA - why and how " by Andrey Kovalenko f...
" Performance testing for Automation QA - why and how " by Andrey Kovalenko f...Lohika_Odessa_TechTalks
 
VCS_QAPerformanceSlides
VCS_QAPerformanceSlidesVCS_QAPerformanceSlides
VCS_QAPerformanceSlidesMichael Cowan
 
Less11 3 e_loadmodule_1
Less11 3 e_loadmodule_1Less11 3 e_loadmodule_1
Less11 3 e_loadmodule_1Suresh Mishra
 
Wap tpresentation (Load testing Tool )
Wap tpresentation (Load testing Tool )Wap tpresentation (Load testing Tool )
Wap tpresentation (Load testing Tool )jagdishdevabhaipatel
 

Similar a Laravel Load Testing: Strategies and Tools (20)

Load and performance testing
Load and performance testingLoad and performance testing
Load and performance testing
 
What is Performance Testing?
What is Performance Testing?What is Performance Testing?
What is Performance Testing?
 
HP LoadRunner
HP LoadRunnerHP LoadRunner
HP LoadRunner
 
Automation Tool Overview
Automation Tool OverviewAutomation Tool Overview
Automation Tool Overview
 
Automation Tools Overview
Automation Tools OverviewAutomation Tools Overview
Automation Tools Overview
 
Performancetestingjmeter 121109061704-phpapp02
Performancetestingjmeter 121109061704-phpapp02Performancetestingjmeter 121109061704-phpapp02
Performancetestingjmeter 121109061704-phpapp02
 
Software Testing includes Performance testing with Load Runner and the JMeter
Software Testing includes Performance testing with Load Runner and the JMeter Software Testing includes Performance testing with Load Runner and the JMeter
Software Testing includes Performance testing with Load Runner and the JMeter
 
Automation Tools Overview
Automation Tools OverviewAutomation Tools Overview
Automation Tools Overview
 
Performance testing jmeter
Performance testing jmeterPerformance testing jmeter
Performance testing jmeter
 
Introduction to performance testing
Introduction to performance testingIntroduction to performance testing
Introduction to performance testing
 
" Performance testing for Automation QA - why and how " by Andrey Kovalenko f...
" Performance testing for Automation QA - why and how " by Andrey Kovalenko f..." Performance testing for Automation QA - why and how " by Andrey Kovalenko f...
" Performance testing for Automation QA - why and how " by Andrey Kovalenko f...
 
JMeter Intro
JMeter IntroJMeter Intro
JMeter Intro
 
J Meter Intro
J Meter IntroJ Meter Intro
J Meter Intro
 
QSpiders - Introduction to JMeter
QSpiders - Introduction to JMeterQSpiders - Introduction to JMeter
QSpiders - Introduction to JMeter
 
VCS_QAPerformanceSlides
VCS_QAPerformanceSlidesVCS_QAPerformanceSlides
VCS_QAPerformanceSlides
 
Less11 3 e_loadmodule_1
Less11 3 e_loadmodule_1Less11 3 e_loadmodule_1
Less11 3 e_loadmodule_1
 
Load Testing.pdf
Load Testing.pdfLoad Testing.pdf
Load Testing.pdf
 
QSpiders - Introduction to HP Load Runner
QSpiders - Introduction to HP Load RunnerQSpiders - Introduction to HP Load Runner
QSpiders - Introduction to HP Load Runner
 
Wap tpresentation (Load testing Tool )
Wap tpresentation (Load testing Tool )Wap tpresentation (Load testing Tool )
Wap tpresentation (Load testing Tool )
 
Testing ppt
Testing pptTesting ppt
Testing ppt
 

Último

Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)Samir Dash
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusZilliz
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...apidays
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Orbitshub
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...apidays
 
Introduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDMIntroduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDMKumar Satyam
 

Último (20)

Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Introduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDMIntroduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDM
 

Laravel Load Testing: Strategies and Tools

  • 1. Laravel Load Testing: Strategies and Tools Muhammad Shehata SWE @RobustaStudio
  • 2. Non-functional Testing Performance Testing K6 by Grafana Labs Load Testing
  • 4. Non-Functional Tests the readiness of a system as per nonfunctional parameters which are not covered by functional testing. We conduct non-functional testing to make sure that users expectations are met. Testing Functional Functional testing verifies that a program is operating according to the technical and business requirements. Functional testers main concern is checking the functionality. Testing
  • 5. Functional Testing Tests what a product does Either present or not present Validated against requirements Requirements are easy to specify Non-functional Testing Tests how a product works Evaluated on a scale Validated against end-user expectations Requirements are hard to specify
  • 8. Why Use Performance Testing? • Performance testing can be used as a diagnostic aid to locate computing or communications bottlenecks within a system. • Performance testing can also verify that a system meets the specifications claimed by its manufacturer or vendor.. Performance Testing
  • 9. Performance Testing Metrics Processor Usage. Amount of time processor spends executing non-idle threads Memory Use. Amount of physical memory available to processes on a computer. Disk Time. Amount of time disk is busy executing a read or write request.
  • 10. Performance Testing Metrics Bandwidth. shows the bits per second used by a network interface. Response Time. time from when a user enters a request until the first character of the response is received. Throughput. rate a computer or network receives requests per second.
  • 11. Performance Testing Metrics Hit Ratio. The number of SQL statements that are handled by cached data instead of expensive I/O operations. Database Locks. Monitoring locking of tables and databases to be carefully tuned. Max. Active Sessions. The maximum number of sessions that can be active at once.
  • 12. Types of Performance Testing Performance Testing Load Testing • Checks the application’s ability to perform under anticipated user loads. The objective is to identify performance bottlenecks before the software application goes live. Stress Testing • Involves testing an application under extreme workloads to see how it handles high traffic or data processing. The objective is to identify the breaking point of an application. Endurance Testing • Is done to make sure the software can handle the expected load over a long period of time. Spike Testing • Tests the software’s reaction to sudden large spikes in the load generated by users. Volume Testing • Under Volume Testing large no. of. Data is populated in a database and the overall software system’s behavior is monitored. The objective is to check software application’s performance under varying database volumes. Scalability Testing • The objective of scalability testing is to determine the software application’s effectiveness in “scaling up” to support an increase in user load. It helps plan capacity addition to your software system.
  • 14. Load Testing Goals LOAD TESTING • Response time for each request • Performance of the system components under different loads • Performance of database components under different loads • Network delay between the client and the server • Software design issues • Server configuration issues like a web server, application server, database server etc. • Hardware limitation issues like CPU maximization, memory limitations, network bottleneck, etc.
  • 15. 01 Architecture Validation Takes place early in the development after a prototype of the app is created. This guarantees the viability of the selected architectural framework. 02 Performance Benchmarking Sets and creates the benchmark tests for the initial version of the app. Gives the Eng. and the QA groups a set of metrics to quantify the scalability. Dev. team will either maintain metrics or improve upon it through the subsequent milestones. 03 Performance Regression. Ensures that the changes made to the app do not result in degradation of performance. Executed when key milestones have been reached or architectural modifications have been made. Load Testing Phases LOAD TESTING
  • 16. 04 Acceptance and Tuning The final load testing phase prior to the official launch. Different scenarios of real-life usage are emulated and the performance of the final configuration is validated. These scenarios are also used to configure the HW and SW components to yield optimal performance. 05 Performance Monitoring After the app is deployed, it is essential to monitor the performance of the system so that crashes or slow-downs can be spotted before they become problematic. Data related to real life usage can be collected to help refine future tests for accurate emulation of load. Load Testing Phases LOAD TESTING
  • 17. Load Testing Criteria • Produce load that stresses all layers of a multi-layer app. • Allow for the emulation of a realistic mix of different groups performing different types of business transaction on the app during peak periods. • Emulate page and resource request patterns. • Validate the responses coming back from the web server for each of the thousands of concurrent users to ensure that the correct pages are being returned by the Web application under stress. LOAD TESTING
  • 18. Load Testing Criteria • Allow for easy maintenance of the scripts testing script. • Dynamic Dial-up of users - this capability allows you to add new users to the load test without stopping the current test. • Real-Time Virtual User Debugger: the load testing tool should have some capability to allow you to visually monitor the progress of a user at any given point in time. • Real-Time Graphs that allow you to understand the scalability characteristics of the application as the load test is in progress. LOAD TESTING
  • 19. Load Testing Criteria • Allow for distributing load tests from a number of machines. • Allow the load tests to be executed with recorded think times, random think times (following some kind of statistical distribution), and with no think times. • Measure response times of entire business transactions in addition to individual objects. • Allow for simulation of different types of caching behaviors. • Allow for complex scheduling to allow for different scenarios of starting, stopping, and ramp-up. LOAD TESTING
  • 21. What is K6 K6 Testing Tool • K6 is an open source load testing tool that is developed by Grafana Labs and the community. • CLI tool with developer-friendly APIs. • Test scripting is done in JavaScript ES2015/ES6. • The tool itself is written in Go to achieve maximum performance.
  • 22. How to Install K6 Testing Tool It can be installed on Linux, MacOS, Windows and of course Docker
  • 23. Running the First Test K6 Testing Tool
  • 24. Scenario A scenario load test is for testing a real-world flow of interactions, e.g.. a user logging in, starting some activity, waiting for progress, and then logging out. The goal here is to test the target system with traffic that is consistent with what you’d see in the real world in terms of URLs/endpoints being hit. Load Testing Unit A unit load test is testing a single unit, like an API endpoint, in isolation. You might primarily be interested in how the endpoint’s performance trends over time, and be alerted to performance regressions. Load Testing
  • 26. Test Life Cycle: Init and VU  The bare minimum for any test is to have default function. Which act as the entry point for the VU.  Code inside default is called "VU code", and is run as long as the test is running. Code outside of it is called "init code", and is run only once per VU.  You can't load anything from your local filesystem, or import any other modules. This all has to be done from the init code.  You can use this to reuse data between iterations (but only for the same VU). K6 Testing Tool
  • 27. Test Life Cycle: Setup and Teardown  setup and teardown are only called once for a test.  function signature of the default function and teardown function can take an argument, This argument will be whatever is returned in the setup function.  Any requests made in the setup and teardown stages will be counted in the end-of-test summary. Those requests will be tagged appropriately with the ::setup and ::teardown K6 Testing Tool
  • 28. HTTP Requests K6 Testing Tool • The first step of creating a load test is defining HTTP request. • K6 HTTP module support all HTTP methods
  • 29. Test Results K6 Testing Tool • Metrics • Checks • Thresholds • Results Output
  • 30. Test Results: Metric Types K6 Testing Tool • A metric that cumulatively sums added values. Counter • Best used to show a range, it stores the min, max and last values added to it. Gauge • A metric that tracks the percentage of values, in our case it will be non-zero values Rate • A pattern found in time series datasets; used to describe data movement either upward or downward. Trend
  • 31. Test Results: Built-in Metrics K6 Testing Tool {
  • 32. Test Results: Custom Metrics K6 Testing Tool • K6 allows you to create custom metrics of any type. • Custom Metrics are reported at the end of the test.
  • 34. Test Results: Checks K6 Testing Tool {
  • 35. Test Results: Thresholds K6 Testing Tool • Thresholds are a pass/fail checks used to verify that the expected performance is met.
  • 36. Test Results: Thresholds K6 Testing Tool Metric Type Aggregation Method Counter count and rate Gauge value Rate rate Trend avg, min, max, med and p(N)
  • 37. External Output K6 Testing Tool • The test summary provides a general overview of your test results. By default, the summary prints to stdout. • K6 supports various built-in outputs
  • 38. Virtual Users Ramping K6 Testing Tool
  • 39. Filtering Results K6 Testing Tool • Groups: organize your load script around common business transaction. • Tags: categorize your checks, thresholds, custom metrics and requests with tags for in-depth filtering.
  • 40. Filtering Results: Groups K6 Testing Tool • Groups can be nested • All metrics emitted in a group will have the tag group with a value of all group names wrapping it separated by '::' (two colons). • The default/root group with the name '' (empty string) which means that if you just have a single group named 'cool requests' the actual value of the group tag will be ::cool requests {
  • 41. Filtering Results: Tags K6 Testing Tool K6 provides two types of tags: • User-defined tags: the ones you've added when writing your script. • System tags: tags automatically assigned by k6.
  • 42. Filtering Results: Tags K6 Testing Tool K6 provides two types of tags: • User-defined tags: the ones you've added when writing your script. • System tags: tags automatically assigned by k6.
  • 43. Scripts K6 Testing Tool • Multiple scenarios can be declared in the same script, and each one can independently execute a different JavaScript function. • Every scenario can use a distinct VU and iteration scheduling pattern. • They can be configured to run in sequence or parallel. • Different environment variables and metric tags can be set per scenario.
  • 44. Scripts K6 Testing Tool • Multiple scenarios can be declared in the same script, and each one can independently execute a different JavaScript function. • Every scenario can use a distinct VU and iteration scheduling pattern. • They can be configured to run in sequence or parallel. • Different environment variables and metric tags can be set per scenario.