SlideShare a Scribd company logo
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

More Related Content

What's hot

Performance testing with Jmeter
Performance testing with JmeterPerformance testing with Jmeter
Performance testing with Jmeter
Prashanth Kumar
 
Load and performance testing
Load and performance testingLoad and performance testing
Load and performance testingQualitest
 
Presentation on Apache Jmeter
Presentation on Apache JmeterPresentation on Apache Jmeter
Presentation on Apache Jmeter
Sabitri Gaire
 
Opentelemetry - From frontend to backend
Opentelemetry - From frontend to backendOpentelemetry - From frontend to backend
Opentelemetry - From frontend to backend
Sebastian Poxhofer
 
LoadRunner Performance Testing
LoadRunner Performance TestingLoadRunner Performance Testing
LoadRunner Performance TestingAtul Pant
 
Continuous Performance Testing with Taurus and Jmeter
Continuous Performance Testing with Taurus and JmeterContinuous Performance Testing with Taurus and Jmeter
Continuous Performance Testing with Taurus and Jmeter
Agile Testing Alliance
 
Observability
ObservabilityObservability
Observability
Martin Gross
 
Go Observability (in practice)
Go Observability (in practice)Go Observability (in practice)
Go Observability (in practice)
Eran Levy
 
Performance testing
Performance testingPerformance testing
Performance testing
Jyoti Babbar
 
Confluent Cloud로 이벤트 기반 마이크로서비스 10배 확장하기 with 29CM
Confluent Cloud로 이벤트 기반 마이크로서비스 10배 확장하기 with 29CMConfluent Cloud로 이벤트 기반 마이크로서비스 10배 확장하기 with 29CM
Confluent Cloud로 이벤트 기반 마이크로서비스 10배 확장하기 with 29CM
confluent
 
Gatling
Gatling Gatling
Gatling
Gaurav Shukla
 
Load testing jmeter
Load testing jmeterLoad testing jmeter
Load testing jmeter
Billa Kota Sriram
 
A Crash Course in Building Site Reliability
A Crash Course in Building Site ReliabilityA Crash Course in Building Site Reliability
A Crash Course in Building Site Reliability
Acquia
 
Introduction to K6
Introduction to K6Introduction to K6
Introduction to K6
Knoldus Inc.
 
Presto as a Service - Tips for operation and monitoring
Presto as a Service - Tips for operation and monitoringPresto as a Service - Tips for operation and monitoring
Presto as a Service - Tips for operation and monitoringTaro L. Saito
 
What is Performance Testing?
What is Performance Testing?What is Performance Testing?
What is Performance Testing?
QA InfoTech
 
Introduction to JMeter
Introduction to JMeterIntroduction to JMeter
Introduction to JMeter
Galih Lasahido
 
Performance Testing
Performance TestingPerformance Testing
Performance Testing
Selin Gungor
 
Introduction to jmeter
Introduction to jmeterIntroduction to jmeter
Introduction to jmeter
test test
 
Performance Testing Using JMeter | Edureka
Performance Testing Using JMeter | EdurekaPerformance Testing Using JMeter | Edureka
Performance Testing Using JMeter | Edureka
Edureka!
 

What's hot (20)

Performance testing with Jmeter
Performance testing with JmeterPerformance testing with Jmeter
Performance testing with Jmeter
 
Load and performance testing
Load and performance testingLoad and performance testing
Load and performance testing
 
Presentation on Apache Jmeter
Presentation on Apache JmeterPresentation on Apache Jmeter
Presentation on Apache Jmeter
 
Opentelemetry - From frontend to backend
Opentelemetry - From frontend to backendOpentelemetry - From frontend to backend
Opentelemetry - From frontend to backend
 
LoadRunner Performance Testing
LoadRunner Performance TestingLoadRunner Performance Testing
LoadRunner Performance Testing
 
Continuous Performance Testing with Taurus and Jmeter
Continuous Performance Testing with Taurus and JmeterContinuous Performance Testing with Taurus and Jmeter
Continuous Performance Testing with Taurus and Jmeter
 
Observability
ObservabilityObservability
Observability
 
Go Observability (in practice)
Go Observability (in practice)Go Observability (in practice)
Go Observability (in practice)
 
Performance testing
Performance testingPerformance testing
Performance testing
 
Confluent Cloud로 이벤트 기반 마이크로서비스 10배 확장하기 with 29CM
Confluent Cloud로 이벤트 기반 마이크로서비스 10배 확장하기 with 29CMConfluent Cloud로 이벤트 기반 마이크로서비스 10배 확장하기 with 29CM
Confluent Cloud로 이벤트 기반 마이크로서비스 10배 확장하기 with 29CM
 
Gatling
Gatling Gatling
Gatling
 
Load testing jmeter
Load testing jmeterLoad testing jmeter
Load testing jmeter
 
A Crash Course in Building Site Reliability
A Crash Course in Building Site ReliabilityA Crash Course in Building Site Reliability
A Crash Course in Building Site Reliability
 
Introduction to K6
Introduction to K6Introduction to K6
Introduction to K6
 
Presto as a Service - Tips for operation and monitoring
Presto as a Service - Tips for operation and monitoringPresto as a Service - Tips for operation and monitoring
Presto as a Service - Tips for operation and monitoring
 
What is Performance Testing?
What is Performance Testing?What is Performance Testing?
What is Performance Testing?
 
Introduction to JMeter
Introduction to JMeterIntroduction to JMeter
Introduction to JMeter
 
Performance Testing
Performance TestingPerformance Testing
Performance Testing
 
Introduction to jmeter
Introduction to jmeterIntroduction to jmeter
Introduction to jmeter
 
Performance Testing Using JMeter | Edureka
Performance Testing Using JMeter | EdurekaPerformance Testing Using JMeter | Edureka
Performance Testing Using JMeter | Edureka
 

Similar to Laravel Load Testing: Strategies and Tools

HP LoadRunner
HP LoadRunnerHP LoadRunner
HP LoadRunner
Fayis-QA
 
Automation Tool Overview
Automation Tool OverviewAutomation Tool Overview
Automation Tool Overview
ANKUR-BA
 
Automation Tools Overview
Automation Tools OverviewAutomation Tools Overview
Automation Tools Overview
Sachin-QA
 
Performancetestingjmeter 121109061704-phpapp02
Performancetestingjmeter 121109061704-phpapp02Performancetestingjmeter 121109061704-phpapp02
Performancetestingjmeter 121109061704-phpapp02
Shivakumara .
 
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 Overview
Murageppa-QA
 
Introduction to performance testing
Introduction to performance testingIntroduction to performance testing
Introduction to performance testing
Richard 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
 
JMeter Intro
JMeter IntroJMeter Intro
JMeter Intro
Sam Varadarajan
 
J Meter Intro
J Meter IntroJ Meter Intro
J Meter Intro
Sam Varadarajan
 
QSpiders - Introduction to JMeter
QSpiders - Introduction to JMeterQSpiders - Introduction to JMeter
QSpiders - Introduction to JMeter
Qspiders - Software Testing Training Institute
 
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_1
Suresh Mishra
 
Load Testing.pdf
Load Testing.pdfLoad Testing.pdf
Load Testing.pdf
YAGYAJAISWAL1
 
QSpiders - Introduction to HP Load Runner
QSpiders - Introduction to HP Load RunnerQSpiders - Introduction to HP Load Runner
QSpiders - Introduction to HP Load Runner
Qspiders - Software Testing Training Institute
 
Wap tpresentation (Load testing Tool )
Wap tpresentation (Load testing Tool )Wap tpresentation (Load testing Tool )
Wap tpresentation (Load testing Tool )
jagdishdevabhaipatel
 
Apidays Helsinki 2024 - Bridging the Gap Between Backend and Frontend API Tes...
Apidays Helsinki 2024 - Bridging the Gap Between Backend and Frontend API Tes...Apidays Helsinki 2024 - Bridging the Gap Between Backend and Frontend API Tes...
Apidays Helsinki 2024 - Bridging the Gap Between Backend and Frontend API Tes...
apidays
 
Testing ppt
Testing pptTesting ppt
Testing ppt
kiran theja
 

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

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
 
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 )
 
Apidays Helsinki 2024 - Bridging the Gap Between Backend and Frontend API Tes...
Apidays Helsinki 2024 - Bridging the Gap Between Backend and Frontend API Tes...Apidays Helsinki 2024 - Bridging the Gap Between Backend and Frontend API Tes...
Apidays Helsinki 2024 - Bridging the Gap Between Backend and Frontend API Tes...
 
Testing ppt
Testing pptTesting ppt
Testing ppt
 
SDLCTesting
SDLCTestingSDLCTesting
SDLCTesting
 
JMeter
JMeterJMeter
JMeter
 

Recently uploaded

Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
DianaGray10
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
UiPathCommunity
 
Assure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyesAssure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
Pierluigi Pugliese
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
Product School
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Alison B. Lowndes
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
nkrafacyberclub
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdfSAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
Peter Spielvogel
 

Recently uploaded (20)

Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
Assure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyesAssure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyes
 
By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdfSAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
 

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.