SlideShare a Scribd company logo
Gatling
Load / Stress Test Tool
Ruchi Agarwal
Knoldus Software LLP
Introduction:
- Gatling is a project that can be used as a load testing tool for analyzing and measuring the
performance of a variety of services, with a focus on web applications
- It is Scala-based, high performance load and stress test tool
- Generates graphical reports with pretty graphs to analyze test report
- Concepts behind Gatling that make it really efficient and easy-to-use:
● Asynchronous concurrency - Actor model
● Asynchronous IOs - Async HTTP Client with Netty
● Scenarios written as DSL - Scala code
Asynchronous concurrency - Actor model:
- Opposed to the "One Thread = One User" model
- Actor model consists in small entities named actors communicating via messages
(asynchronous concurrency).
- Actors are composed of:
● a Mailbox which stores all the messages received
● a Computation Unit which executes a predefined action for each received message
- This allows the Gatling engine to be more efficient and reduces drastically the number of
threads needed to run lots of users (~50 threads for 2000 users in Gatling's case).
- To use actors, Gatling rely on the Akka actor library, which is much efficient and part of the
Typesafe Stack.
Asynchronous IOs - Async HTTP Client with Netty:
- To benefit fully from the actor model, Gatling also used asynchronous IOs
- This allows actors to send a request to the tested application, and pass to the next message
they received instead of waiting for a response. This saves a lot of time.
- To send these asynchronous requests, used the Async HTTP Client library with Netty as the
underlying HTTP library
- Async HTTP Client, purpose is to easily execute HTTP requests and asynchronously
process the HTTP responses
- Netty, is an asynchronous event-driven network application framework for rapid
development of maintainable high performance protocol servers & clients
Scenarios written as DSL - Scala code:
- Used a Domain Specific Language (DSL) to describe scenarios in Gatling
- Scenarios are written in Scala code
- Example:
scenario("Standard User")
.exec(
http("Access Github").get("http://github.com")
.check(status.is(200)))
.pause(2, 3)
.exec(
http("Search for gatling'")
.get("http://github.com/search").queryParam("q", "gatling")
.check(status.is(200)))
.pause(2)
1. Access Github is a GET request pointing at http://github.com
2. Search for 'gatling' is a GET request pointing at http://github.com/search?q=gatling
Simulations:
- A simulation is a load test. It is made of different scenarios, each representing a typical user
behavior
- At the last of the file contains the simulation definition, where defines the load want to inject
to the server. Eg:
setUp(scn.inject(rampUsers(10) over (1 seconds))).protocols(httpConf)
setUp(scn.inject(atOnceUsers(10))).protocols(httpConf)
Gatling-sbt:
- Sbt- version: 0.13.5
- plugins.sbt:
resolvers += "Sonatype OSS Snapshots" at
"https://oss.sonatype.org/content/repositories/snapshots"
addSbtPlugin("io.gatling" % "sbt-plugin" % "1.0-SNAPSHOT")
- build.sbt:
"io.gatling.highcharts" % "gatling-charts-highcharts" % "2.0.0-SNAPSHOT" % "test"
"io.gatling" % "test-framework" % "1.0-SNAPSHOT" % "test"
val test = project.in(file("."))
.enablePlugins(GatlingPlugin)
.settings(resolvers += "Sonatype OSS Snapshots" at
"https://oss.sonatype.org/content/repositories/snapshots")
.settings(libraryDependencies ++= /* Gatling dependencies */)
Run Gatling simulations:
- gatling:test, runs the all gatling test files found in src/test/scala
● By default, Gatling simulations must be in src/test/scala, configurable using the
scalaSource in Gatling setting
● By default, Gatling reports are written to target/gatling, configurable using the
target in Gatling setting
- gatling:testOnly
- gatling:testQuick
- gatling:startRecorder, launches the Recorder pre-configured to write recorded
simulations to your tests sources folder
- gatling:lastReport, opens the last generated report in your default web browser
Gatling over JMetre:
- Gatling’s clean DSL API (written in Scala) as opposed to the JMeter misuse of XML.
XML is not a programming language and should not be used that way. Using DSL is a great
advantage since we want to treat performance tests as a code.
- High performance - gatling uses asynchronous concurrency (Scala, Akka, Netty) and
asynchronous IO. This approach scales a lot better than the standard stress tools using one
thread per user.
- Gatling by comparison has a very light profile in terms of JVM performance.
- Generated more clean and understable graphical reports
References:
● http://gatling-tool.org/
● https://github.com/excilys/gatling/wiki/Concepts
● https://github.com/gatling/gatling-sbt
● http://de.slideshare.net/slandelle/gatling-j-duchess-20121017-14830793
● https://github.com/excilys/gatling/wiki/First-Steps-with-Gatling
● https://blog.bluepyth.fr/gatling-stress-tool-made-efficient.html
Gatling - Stress test tool

More Related Content

PPTX
Gatling overview
ODP
Gatling
ODP
Boost your App with Gatling
PPTX
Selenium
PDF
Basic Java Programming
PDF
Quarkus - a next-generation Kubernetes Native Java framework
PPT
presentation on Docker
PPTX
Automation Testing With Appium
Gatling overview
Gatling
Boost your App with Gatling
Selenium
Basic Java Programming
Quarkus - a next-generation Kubernetes Native Java framework
presentation on Docker
Automation Testing With Appium

What's hot (20)

PPTX
Jenkins tutorial
PDF
Jenkins with SonarQube
PDF
맛만 보자 액터 모델이란
PDF
Jenkins tutorial
PPTX
End to end test automation with cypress
PPTX
Interop 2018 - Understanding Kubernetes - Brian Gracely
PPTX
Performance testing locust
PPTX
android sqlite
PPTX
Introduction to Docker - 2017
PPTX
Docker introduction (1)
PDF
Introduction to Docker Containers - Docker Captain
PDF
Docker Introduction
PDF
Introduction to flutter
PPTX
Introduction to jenkins
PPTX
Automation testing & Unit testing
PPSX
PPTX
Ansible presentation
PPT
Core java
PPTX
Introduction to JavaScript
Jenkins tutorial
Jenkins with SonarQube
맛만 보자 액터 모델이란
Jenkins tutorial
End to end test automation with cypress
Interop 2018 - Understanding Kubernetes - Brian Gracely
Performance testing locust
android sqlite
Introduction to Docker - 2017
Docker introduction (1)
Introduction to Docker Containers - Docker Captain
Docker Introduction
Introduction to flutter
Introduction to jenkins
Automation testing & Unit testing
Ansible presentation
Core java
Introduction to JavaScript
Ad

Viewers also liked (20)

PDF
Load testing with gatling
PDF
Blast your app with Gatling! by Stephane Landelle
PDF
Load test REST APIs using gatling
PDF
Performance and stability testing \w Gatling
PDF
Gatling @ Scala.Io 2013
PDF
Skinny Framework 1.0.0
PDF
Performance testing with Gatling
ODP
Performance Test Automation With Gatling
PDF
Hands On, Duchess 10/17/2012
PDF
Three Lessons about Gatling and Microservices
PDF
Gatling - Bordeaux JUG
PDF
Démo Gatling au Performance User Group de Casablanca - 25 sept 2014
PDF
DSLing your System For Scalability Testing Using Gatling - Dublin Scala User ...
PPTX
Load-testing 101 for Startups with Artillery.io
PDF
20150605 영남대 특강_변민우
PDF
Messaging Patterns with Akka (Remote) Actors
PDF
Gatling - oružje u redovima performansnog testiranja
PPTX
Meetup TestingAR 2016 - Performance testing durante y después
PPTX
Load testing with Telerik Test Studio
PPTX
QA&test 2016 (Bilbao) Pros and Cons of Doing Performance Testing Along with D...
Load testing with gatling
Blast your app with Gatling! by Stephane Landelle
Load test REST APIs using gatling
Performance and stability testing \w Gatling
Gatling @ Scala.Io 2013
Skinny Framework 1.0.0
Performance testing with Gatling
Performance Test Automation With Gatling
Hands On, Duchess 10/17/2012
Three Lessons about Gatling and Microservices
Gatling - Bordeaux JUG
Démo Gatling au Performance User Group de Casablanca - 25 sept 2014
DSLing your System For Scalability Testing Using Gatling - Dublin Scala User ...
Load-testing 101 for Startups with Artillery.io
20150605 영남대 특강_변민우
Messaging Patterns with Akka (Remote) Actors
Gatling - oružje u redovima performansnog testiranja
Meetup TestingAR 2016 - Performance testing durante y después
Load testing with Telerik Test Studio
QA&test 2016 (Bilbao) Pros and Cons of Doing Performance Testing Along with D...
Ad

Similar to Gatling - Stress test tool (20)

PDF
API Performance testing with Gatling
PPTX
Gatling
PDF
Load testing in Zonky with Gatling
PPTX
Gatling Tool in Action at Devoxx 2012
PDF
Gatling Performance Workshop
PDF
Gatling workshop lets test17
PDF
Codemotion tech pills - Continuous performance
PPTX
Gatling : Faites tomber la foudre sur votre serveur ! (Stéphane Landelle)
PDF
Performance tests with gatling
PDF
GatlingJAX2022.pdf
PDF
QA Fest 2019. Антон Молдован. Load testing which you always wanted
PDF
Amsterdam JUG - Continuous performance
PDF
DeTesters meetup november 2018 - Continuous performance: load testing with G...
PDF
Continuous performance: Load testing for developers with gatling @ Utrecht JUG
PDF
Mateusz Gruszczynski - Performance tests in Gatling (Quality Questions Confer...
PPTX
Stress test data pipeline
PDF
Gatling.pptx
PDF
Continuous Performance - Load testing for developers with gatling @ iSense 2016
PDF
Continuous performance: Load testing for developers with gatling @ JavaOne 2016
PDF
Gatling - JUGL, 2012-09-13
API Performance testing with Gatling
Gatling
Load testing in Zonky with Gatling
Gatling Tool in Action at Devoxx 2012
Gatling Performance Workshop
Gatling workshop lets test17
Codemotion tech pills - Continuous performance
Gatling : Faites tomber la foudre sur votre serveur ! (Stéphane Landelle)
Performance tests with gatling
GatlingJAX2022.pdf
QA Fest 2019. Антон Молдован. Load testing which you always wanted
Amsterdam JUG - Continuous performance
DeTesters meetup november 2018 - Continuous performance: load testing with G...
Continuous performance: Load testing for developers with gatling @ Utrecht JUG
Mateusz Gruszczynski - Performance tests in Gatling (Quality Questions Confer...
Stress test data pipeline
Gatling.pptx
Continuous Performance - Load testing for developers with gatling @ iSense 2016
Continuous performance: Load testing for developers with gatling @ JavaOne 2016
Gatling - JUGL, 2012-09-13

More from Knoldus Inc. (20)

PPTX
Angular Hydration Presentation (FrontEnd)
PPTX
Optimizing Test Execution: Heuristic Algorithm for Self-Healing
PPTX
Self-Healing Test Automation Framework - Healenium
PPTX
Kanban Metrics Presentation (Project Management)
PPTX
Java 17 features and implementation.pptx
PPTX
Chaos Mesh Introducing Chaos in Kubernetes
PPTX
GraalVM - A Step Ahead of JVM Presentation
PPTX
Nomad by HashiCorp Presentation (DevOps)
PPTX
Nomad by HashiCorp Presentation (DevOps)
PPTX
DAPR - Distributed Application Runtime Presentation
PPTX
Introduction to Azure Virtual WAN Presentation
PPTX
Introduction to Argo Rollouts Presentation
PPTX
Intro to Azure Container App Presentation
PPTX
Insights Unveiled Test Reporting and Observability Excellence
PPTX
Introduction to Splunk Presentation (DevOps)
PPTX
Code Camp - Data Profiling and Quality Analysis Framework
PPTX
AWS: Messaging Services in AWS Presentation
PPTX
Amazon Cognito: A Primer on Authentication and Authorization
PPTX
ZIO Http A Functional Approach to Scalable and Type-Safe Web Development
PPTX
Managing State & HTTP Requests In Ionic.
Angular Hydration Presentation (FrontEnd)
Optimizing Test Execution: Heuristic Algorithm for Self-Healing
Self-Healing Test Automation Framework - Healenium
Kanban Metrics Presentation (Project Management)
Java 17 features and implementation.pptx
Chaos Mesh Introducing Chaos in Kubernetes
GraalVM - A Step Ahead of JVM Presentation
Nomad by HashiCorp Presentation (DevOps)
Nomad by HashiCorp Presentation (DevOps)
DAPR - Distributed Application Runtime Presentation
Introduction to Azure Virtual WAN Presentation
Introduction to Argo Rollouts Presentation
Intro to Azure Container App Presentation
Insights Unveiled Test Reporting and Observability Excellence
Introduction to Splunk Presentation (DevOps)
Code Camp - Data Profiling and Quality Analysis Framework
AWS: Messaging Services in AWS Presentation
Amazon Cognito: A Primer on Authentication and Authorization
ZIO Http A Functional Approach to Scalable and Type-Safe Web Development
Managing State & HTTP Requests In Ionic.

Recently uploaded (20)

PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Approach and Philosophy of On baking technology
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PPTX
Big Data Technologies - Introduction.pptx
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PDF
Encapsulation_ Review paper, used for researhc scholars
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Empathic Computing: Creating Shared Understanding
PPTX
A Presentation on Artificial Intelligence
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Understanding_Digital_Forensics_Presentation.pptx
The Rise and Fall of 3GPP – Time for a Sabbatical?
MYSQL Presentation for SQL database connectivity
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Approach and Philosophy of On baking technology
Review of recent advances in non-invasive hemoglobin estimation
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Network Security Unit 5.pdf for BCA BBA.
NewMind AI Weekly Chronicles - August'25 Week I
Big Data Technologies - Introduction.pptx
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
Encapsulation_ Review paper, used for researhc scholars
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Empathic Computing: Creating Shared Understanding
A Presentation on Artificial Intelligence

Gatling - Stress test tool

  • 1. Gatling Load / Stress Test Tool Ruchi Agarwal Knoldus Software LLP
  • 2. Introduction: - Gatling is a project that can be used as a load testing tool for analyzing and measuring the performance of a variety of services, with a focus on web applications - It is Scala-based, high performance load and stress test tool - Generates graphical reports with pretty graphs to analyze test report - Concepts behind Gatling that make it really efficient and easy-to-use: ● Asynchronous concurrency - Actor model ● Asynchronous IOs - Async HTTP Client with Netty ● Scenarios written as DSL - Scala code
  • 3. Asynchronous concurrency - Actor model: - Opposed to the "One Thread = One User" model - Actor model consists in small entities named actors communicating via messages (asynchronous concurrency). - Actors are composed of: ● a Mailbox which stores all the messages received ● a Computation Unit which executes a predefined action for each received message - This allows the Gatling engine to be more efficient and reduces drastically the number of threads needed to run lots of users (~50 threads for 2000 users in Gatling's case). - To use actors, Gatling rely on the Akka actor library, which is much efficient and part of the Typesafe Stack.
  • 4. Asynchronous IOs - Async HTTP Client with Netty: - To benefit fully from the actor model, Gatling also used asynchronous IOs - This allows actors to send a request to the tested application, and pass to the next message they received instead of waiting for a response. This saves a lot of time. - To send these asynchronous requests, used the Async HTTP Client library with Netty as the underlying HTTP library - Async HTTP Client, purpose is to easily execute HTTP requests and asynchronously process the HTTP responses - Netty, is an asynchronous event-driven network application framework for rapid development of maintainable high performance protocol servers & clients
  • 5. Scenarios written as DSL - Scala code: - Used a Domain Specific Language (DSL) to describe scenarios in Gatling - Scenarios are written in Scala code - Example: scenario("Standard User") .exec( http("Access Github").get("http://github.com") .check(status.is(200))) .pause(2, 3) .exec( http("Search for gatling'") .get("http://github.com/search").queryParam("q", "gatling") .check(status.is(200))) .pause(2) 1. Access Github is a GET request pointing at http://github.com 2. Search for 'gatling' is a GET request pointing at http://github.com/search?q=gatling
  • 6. Simulations: - A simulation is a load test. It is made of different scenarios, each representing a typical user behavior - At the last of the file contains the simulation definition, where defines the load want to inject to the server. Eg: setUp(scn.inject(rampUsers(10) over (1 seconds))).protocols(httpConf) setUp(scn.inject(atOnceUsers(10))).protocols(httpConf)
  • 7. Gatling-sbt: - Sbt- version: 0.13.5 - plugins.sbt: resolvers += "Sonatype OSS Snapshots" at "https://oss.sonatype.org/content/repositories/snapshots" addSbtPlugin("io.gatling" % "sbt-plugin" % "1.0-SNAPSHOT") - build.sbt: "io.gatling.highcharts" % "gatling-charts-highcharts" % "2.0.0-SNAPSHOT" % "test" "io.gatling" % "test-framework" % "1.0-SNAPSHOT" % "test" val test = project.in(file(".")) .enablePlugins(GatlingPlugin) .settings(resolvers += "Sonatype OSS Snapshots" at "https://oss.sonatype.org/content/repositories/snapshots") .settings(libraryDependencies ++= /* Gatling dependencies */)
  • 8. Run Gatling simulations: - gatling:test, runs the all gatling test files found in src/test/scala ● By default, Gatling simulations must be in src/test/scala, configurable using the scalaSource in Gatling setting ● By default, Gatling reports are written to target/gatling, configurable using the target in Gatling setting - gatling:testOnly - gatling:testQuick - gatling:startRecorder, launches the Recorder pre-configured to write recorded simulations to your tests sources folder - gatling:lastReport, opens the last generated report in your default web browser
  • 9. Gatling over JMetre: - Gatling’s clean DSL API (written in Scala) as opposed to the JMeter misuse of XML. XML is not a programming language and should not be used that way. Using DSL is a great advantage since we want to treat performance tests as a code. - High performance - gatling uses asynchronous concurrency (Scala, Akka, Netty) and asynchronous IO. This approach scales a lot better than the standard stress tools using one thread per user. - Gatling by comparison has a very light profile in terms of JVM performance. - Generated more clean and understable graphical reports
  • 10. References: ● http://gatling-tool.org/ ● https://github.com/excilys/gatling/wiki/Concepts ● https://github.com/gatling/gatling-sbt ● http://de.slideshare.net/slandelle/gatling-j-duchess-20121017-14830793 ● https://github.com/excilys/gatling/wiki/First-Steps-with-Gatling ● https://blog.bluepyth.fr/gatling-stress-tool-made-efficient.html