SlideShare a Scribd company logo
With Gatling
Performance & Stability Testing
Development Testing
Performance and stability testing \w Gatling
@Me
Dmitry Vrublevsky,
Software developer @
/in/dmitryvrublevsky
Roadmap
- Mission overview
- Gatling introduction
- Some usage example
Mission
Given: Graph database (Neo4j)
Challenge: execute query as FAST as we can
Neo4j
- Written in Java
- Native graph storage
- Extendable
Performance and stability testing \w Gatling
So?
- Default API is too slow
- Implement custom extension
- Control all the things
1. Developed
2. Deployed
3. ???
4. Success!
Performance and stability testing \w Gatling
Performance
Specification
Do “X” operations
in “Y” seconds
Specification
Do “10000” query operations
in “10” seconds
POST /extension/query
Body: “MATCH (root)-[:HAS*]->(child)”
Response:
{
// JSON data
}
Client
LB
DB1 DB2 DB3
- our extension
Problems?
Client
LB
DB1 DB2 DB3
- our extension
- possible problem
Gatling
http://gatling.io
Load testing framework
Free & Open source
High performance
Performance and stability testing \w Gatling
Friendly DSL
Nice html reports
Coding ?
Bundle
1. Download bundle
2. Extract
3. Ready
http://gatling.io/#/download
Optional
- Maven integration
- SBT plugin
- Gradle plugin
package com.neueda.example



import io.gatling.core.Predef._

import io.gatling.http.Predef._

import scala.concurrent.duration._



class Example extends Simulation {

val httpConf = http.baseURL("http://www.example.com")



val example = scenario("Example")

.exec(

http("get_example_index")

.get("/")

.check(status.is(200))

)



setUp(

example.inject(rampUsers(10) over (10 seconds))

).protocols(httpConf)

}
package com.neueda.example



import io.gatling.core.Predef._

import io.gatling.http.Predef._

import scala.concurrent.duration._

class Example extends Simulation {



}
val httpConf =
http.baseURL("http://www.example.com")
val example = scenario("Example")
http("get_example_index")

.get("/")

.check(status.is(200))
setUp(

).protocols(httpConf)
example.inject(
rampUsers(10) over (10 seconds)
)
package com.neueda.example



import io.gatling.core.Predef._

import io.gatling.http.Predef._

import scala.concurrent.duration._



class Example extends Simulation {

val httpConf = http.baseURL("http://www.example.com")



val example = scenario("Example")

.exec(

http("get_example_index")

.get("/")

.check(status.is(200))

)



setUp(

example.inject(rampUsers(10) over (10 seconds))

).protocols(httpConf)

}
http://gatling.io/docs/2.1.4/cheat-sheet.html
================================================================================
2015-04-07 23:02:54 5s elapsed
---- Example -------------------------------------------------------------------
[##################################### ] 50%
waiting: 5 / running: 0 / done:5
---- Requests ------------------------------------------------------------------
> Global (OK=5 KO=0 )
> get_example_index (OK=5 KO=0 )
================================================================================
================================================================================
---- Global Information --------------------------------------------------------
> request count 10 (OK=10 KO=0 )
> min response time 255 (OK=255 KO=- )
> max response time 302 (OK=302 KO=- )
> mean response time 274 (OK=274 KO=- )
> std deviation 13 (OK=13 KO=- )
> response time 95th percentile 293 (OK=293 KO=- )
> response time 99th percentile 300 (OK=300 KO=- )
> mean requests/sec 1.08 (OK=1.08 KO=- )
---- Response Time Distribution ------------------------------------------------
> t < 800 ms 10 (100%)
> 800 ms < t < 1200 ms 0 ( 0%)
> t > 1200 ms 0 ( 0%)
> failed 0 ( 0%)
================================================================================
================================================================================
2015-04-07 23:02:54 5s elapsed
---- Example -------------------------------------------------------------------
[##################################### ] 50%
waiting: 5 / running: 0 / done:5
---- Requests ------------------------------------------------------------------
> Global (OK=5 KO=0 )
> get_example_index (OK=5 KO=0 )
================================================================================
================================================================================
---- Global Information --------------------------------------------------------
> request count 10 (OK=10 KO=0 )
> min response time 255 (OK=255 KO=- )
> max response time 302 (OK=302 KO=- )
> mean response time 274 (OK=274 KO=- )
> std deviation 13 (OK=13 KO=- )
> response time 95th percentile 293 (OK=293 KO=- )
> response time 99th percentile 300 (OK=300 KO=- )
> mean requests/sec 1.08 (OK=1.08 KO=- )
---- Response Time Distribution ------------------------------------------------
> t < 800 ms 10 (100%)
> 800 ms < t < 1200 ms 0 ( 0%)
> t > 1200 ms 0 ( 0%)
> failed 0 ( 0%)
================================================================================
Reports o/
Performance and stability testing \w Gatling
Performance and stability testing \w Gatling
Performance and stability testing \w Gatling
Performance and stability testing \w Gatling
class Test extends Simulation {

val httpConf = http.baseURL("http://neo-database:7474")



val test = scenario("GetGraph")

.exec(

http("execute_query")

.post("/extension/query/execute")

.body(StringBody("MATCH (root)-[:HAS*]->(child)"))

.check(status.is(200))

.check(jsonPath("$.results").count.is(100))

)



setUp(

test.inject(

rampUsersPerSec(0) to (1000) during (60 seconds)

)

).protocols(httpConf)

}
http("execute_query")

.post(
"/extension/query/execute"
)

.body(StringBody(
"MATCH (root)-[:HAS*]->(child)"
))

.check(
status.is(200)
)

.check(
jsonPath("$.results").count.is(100)
)
1
2
3
4
rampUsersPerSec(0) to (1000) during (60 seconds)
Requests/Second
0
150
300
450
600
Seconds
0 10 20 30 40 50 60
Performance and stability testing \w Gatling
When request/second goes up
And some threshold reached
Then we receive Timeout error
Everything is ok?
Maybe we can do higher load?
How to spot the problem?
Drop all
non-essential
parts
Client
LB
DB1 DB2 DB3
- our extension
0
250
500
750
1000
0 10 20 30 40 50 60
Performance and stability testing \w Gatling
Client - Server
communication
problems
• Incorrect server setup
• Unconfigured networking
• Low max open connection limit
Learned
- Performance testing should be done
- Test results should be interpreted
properly
- Test results should be verified in
different environments
We need to test
different queries
Feeders!
val feeder = Array(

Map("query" -> "..."),

Map("query" -> "..."),

Map("query" -> "...")

)
.queue
.random
.circular


val test = scenario(“GetGraph")
.feed(feeder)

.exec(http("execute_query")

.post("/extension/query/execute")

.body(StringBody("${query}"))

.check(status.is(200))

.check(jsonPath("$.results").count.is(100))

)
CSV
JSON
JDBC
Sitemap
Redis
Custom
http://gatling.io/docs/2.1.4/session/feeder.html
csv("data.csv").random
Our own feeder
- Custom feeder
- Lazy loads data
- Performant
Dynamic user load?
http://gatling.io/docs/2.1.4/general/simulation_setup.html
test.inject(

nothingFor(5 seconds),
atOnceUsers(10),

rampUsersPerSec(10) to (100) during (20 seconds),

constantUsersPerSec(100) during (40 seconds),

rampUsersPerSec(100) to (500) during (20 second),

constantUsersPerSec(100) during (60 seconds)

)
Checks
http://gatling.io/docs/2.1.4/http/http_check.html
- status
- currentLocation
- header
- regex
- xpath
- jsonPath
regex("Invalid Page title").notExists

status.is(200)

jsonPath("$.posts").exists

regex("""<div class="article">""").count.is(10)
Realtime monitoring
http://gatling.io/docs/2.1.4/realtime_monitoring/index.html
Execution progress visual feedback
Graphite (InfluxDB)
+
Grafana
Performance and stability testing \w Gatling
Recorder
http://gatling.io/docs/2.1.4/http/recorder.html
Performance and stability testing \w Gatling
HTTP
http://gatling.io/docs/2.1.4/http/recorder.html
- HTTP Protocol
- SSL
- WebSocket
- SSE
Jenkins integration
https://github.com/jenkinsci/gatling-plugin
- Any IDE with Scala support is OK
- Intellij IDEA
- Eclipse (Scala IDE)
- Netbeans
Our use cases
GET /api/node/1
POST /api/node
UPDATE /api/node
Basic API tests
- Generate background load
- Make stability tests
- Cluster communications
- Load balancer setup
- Spikes
Load generator
- Simulate significant write load
- Check how database reacts
Data import
Easy
Fun
Performant
Performance and stability testing \w Gatling

More Related Content

What's hot (20)

PDF
Apache MXNet Distributed Training Explained In Depth by Viacheslav Kovalevsky...
Big Data Spain
 
PDF
VCL template abstraction model and automated deployments to Fastly
Fastly
 
PPTX
To Hire, or to train, that is the question (Percona Live 2014)
Geoffrey Anderson
 
PDF
"Swoole: double troubles in c", Alexandr Vronskiy
Fwdays
 
PDF
PyGotham 2014 Introduction to Profiling
Perrin Harkins
 
PDF
Tips on how to improve the performance of your custom modules for high volume...
Odoo
 
PDF
Elasticsearch (R)Evolution — You Know, for Search… by Philipp Krenn at Big Da...
Big Data Spain
 
PDF
Top Node.js Metrics to Watch
Sematext Group, Inc.
 
KEY
PyCon US 2012 - State of WSGI 2
Graham Dumpleton
 
PPT
{{more}} Kibana4
琛琳 饶
 
PDF
Celery
Fatih Erikli
 
PPTX
How NOT to write in Node.js
Piotr Pelczar
 
PDF
Raymond Kuiper - Working the API like a Unix Pro
Zabbix
 
PPTX
Run Node Run
Kevin Swiber
 
PDF
Introduction to performance tuning perl web applications
Perrin Harkins
 
PDF
Go database/sql
Artem Kovardin
 
PPTX
Creating Reusable Puppet Profiles
Bram Vogelaar
 
PDF
Building Scalable Websites with Perl
Perrin Harkins
 
PDF
Future Decoded - Node.js per sviluppatori .NET
Gianluca Carucci
 
PDF
Autoscaling with hashi_corp_nomad
Bram Vogelaar
 
Apache MXNet Distributed Training Explained In Depth by Viacheslav Kovalevsky...
Big Data Spain
 
VCL template abstraction model and automated deployments to Fastly
Fastly
 
To Hire, or to train, that is the question (Percona Live 2014)
Geoffrey Anderson
 
"Swoole: double troubles in c", Alexandr Vronskiy
Fwdays
 
PyGotham 2014 Introduction to Profiling
Perrin Harkins
 
Tips on how to improve the performance of your custom modules for high volume...
Odoo
 
Elasticsearch (R)Evolution — You Know, for Search… by Philipp Krenn at Big Da...
Big Data Spain
 
Top Node.js Metrics to Watch
Sematext Group, Inc.
 
PyCon US 2012 - State of WSGI 2
Graham Dumpleton
 
{{more}} Kibana4
琛琳 饶
 
Celery
Fatih Erikli
 
How NOT to write in Node.js
Piotr Pelczar
 
Raymond Kuiper - Working the API like a Unix Pro
Zabbix
 
Run Node Run
Kevin Swiber
 
Introduction to performance tuning perl web applications
Perrin Harkins
 
Go database/sql
Artem Kovardin
 
Creating Reusable Puppet Profiles
Bram Vogelaar
 
Building Scalable Websites with Perl
Perrin Harkins
 
Future Decoded - Node.js per sviluppatori .NET
Gianluca Carucci
 
Autoscaling with hashi_corp_nomad
Bram Vogelaar
 

Viewers also liked (17)

ODP
Gatling - Stress test tool
Knoldus Inc.
 
PDF
Blast your app with Gatling! by Stephane Landelle
ZeroTurnaround
 
PDF
Performance testing with Gatling
Andrzej Michałowski
 
PDF
Démo Gatling au Performance User Group de Casablanca - 25 sept 2014
Benoît de CHATEAUVIEUX
 
PDF
Load testing with gatling
Chris Birchall
 
PDF
JIRA Performance Testing in Pictures - Edward Bukoski Michael March
Atlassian
 
PPTX
Accelerated Stability Testing.
Maha Alkhalifah
 
PDF
ICH Stability testing of new drug substances and products QA (R2) - 2015
Pharmaceutical Compliance Inspection unit, Crown College of Canada
 
PPTX
Seminor on accelerated stability testing of dosage forms sahil
sahilhusen
 
PDF
ICH Stability Studies
sandeepdecharaju
 
PPTX
A ppt on accelerated stability studies
shrikanth varma Bandi
 
PPT
Stability testing and shelf life estimation
Manish sharma
 
PPTX
Drug stability
Wilwin Edara
 
PPTX
Ich guidelines for stability studies 1
priyanka odela
 
PPTX
Perf university
Henri Tremblay
 
PPT
Accelerated stability studes
Sunil Boreddy Rx
 
PPTX
Tester unitairement une application java
Antoine Rey
 
Gatling - Stress test tool
Knoldus Inc.
 
Blast your app with Gatling! by Stephane Landelle
ZeroTurnaround
 
Performance testing with Gatling
Andrzej Michałowski
 
Démo Gatling au Performance User Group de Casablanca - 25 sept 2014
Benoît de CHATEAUVIEUX
 
Load testing with gatling
Chris Birchall
 
JIRA Performance Testing in Pictures - Edward Bukoski Michael March
Atlassian
 
Accelerated Stability Testing.
Maha Alkhalifah
 
ICH Stability testing of new drug substances and products QA (R2) - 2015
Pharmaceutical Compliance Inspection unit, Crown College of Canada
 
Seminor on accelerated stability testing of dosage forms sahil
sahilhusen
 
ICH Stability Studies
sandeepdecharaju
 
A ppt on accelerated stability studies
shrikanth varma Bandi
 
Stability testing and shelf life estimation
Manish sharma
 
Drug stability
Wilwin Edara
 
Ich guidelines for stability studies 1
priyanka odela
 
Perf university
Henri Tremblay
 
Accelerated stability studes
Sunil Boreddy Rx
 
Tester unitairement une application java
Antoine Rey
 
Ad

Similar to Performance and stability testing \w Gatling (20)

PPTX
Performance tests with Gatling
Andrzej Ludwikowski
 
PDF
Load testing with Blitz
Lindsay Holmwood
 
PDF
Load Data Fast!
Karwin Software Solutions LLC
 
PDF
Distributed load testing with K6 - NDC London 2024
Thijs Feryn
 
PDF
Distributed Load Testing with k6 - DevOps Barcelona
Thijs Feryn
 
PDF
Distributed load testing with k6
Thijs Feryn
 
PDF
Rich and Snappy Apps (No Scaling Required)
Thomas Fuchs
 
PDF
Performance tests - it's a trap
Andrzej Ludwikowski
 
PDF
How we use and deploy Varnish at Opera
Cosimo Streppone
 
KEY
Polyglot parallelism
Phillip Toland
 
PDF
Matteo Collina | Take your HTTP server to Ludicrous Speed | Codmeotion Madrid...
Codemotion
 
PDF
2011/1/27 Amazon Route53 使ってみた@第1回クラウド女子会
Miki Takata
 
KEY
fog or: How I Learned to Stop Worrying and Love the Cloud
Wesley Beary
 
KEY
fog or: How I Learned to Stop Worrying and Love the Cloud (OpenStack Edition)
Wesley Beary
 
PDF
Play vs Rails
Daniel Cukier
 
PDF
Postgres performance for humans
Craig Kerstiens
 
PDF
Parallel Computing With Dask - PyDays 2017
Christian Aichinger
 
PDF
MongoDB World 2019: Life In Stitch-es
MongoDB
 
PDF
QA Fest 2019. Антон Молдован. Load testing which you always wanted
QAFest
 
PDF
Anton Moldovan "Load testing which you always wanted"
Fwdays
 
Performance tests with Gatling
Andrzej Ludwikowski
 
Load testing with Blitz
Lindsay Holmwood
 
Distributed load testing with K6 - NDC London 2024
Thijs Feryn
 
Distributed Load Testing with k6 - DevOps Barcelona
Thijs Feryn
 
Distributed load testing with k6
Thijs Feryn
 
Rich and Snappy Apps (No Scaling Required)
Thomas Fuchs
 
Performance tests - it's a trap
Andrzej Ludwikowski
 
How we use and deploy Varnish at Opera
Cosimo Streppone
 
Polyglot parallelism
Phillip Toland
 
Matteo Collina | Take your HTTP server to Ludicrous Speed | Codmeotion Madrid...
Codemotion
 
2011/1/27 Amazon Route53 使ってみた@第1回クラウド女子会
Miki Takata
 
fog or: How I Learned to Stop Worrying and Love the Cloud
Wesley Beary
 
fog or: How I Learned to Stop Worrying and Love the Cloud (OpenStack Edition)
Wesley Beary
 
Play vs Rails
Daniel Cukier
 
Postgres performance for humans
Craig Kerstiens
 
Parallel Computing With Dask - PyDays 2017
Christian Aichinger
 
MongoDB World 2019: Life In Stitch-es
MongoDB
 
QA Fest 2019. Антон Молдован. Load testing which you always wanted
QAFest
 
Anton Moldovan "Load testing which you always wanted"
Fwdays
 
Ad

Recently uploaded (20)

PDF
TrustArc Webinar - Navigating APAC Data Privacy Laws: Compliance & Challenges
TrustArc
 
PPTX
Smart Factory Monitoring IIoT in Machine and Production Operations.pptx
Rejig Digital
 
PDF
99 Bottles of Trust on the Wall — Operational Principles for Trust in Cyber C...
treyka
 
PPTX
01_Approach Cyber- DORA Incident Management.pptx
FinTech Belgium
 
PDF
Supporting the NextGen 911 Digital Transformation with FME
Safe Software
 
PDF
My Journey from CAD to BIM: A True Underdog Story
Safe Software
 
PDF
Proactive Server and System Monitoring with FME: Using HTTP and System Caller...
Safe Software
 
PPTX
Practical Applications of AI in Local Government
OnBoard
 
PDF
How to Visualize the ​Spatio-Temporal Data Using CesiumJS​
SANGHEE SHIN
 
PDF
Bitkom eIDAS Summit | European Business Wallet: Use Cases, Macroeconomics, an...
Carsten Stoecker
 
PPTX
Mastering Authorization: Integrating Authentication and Authorization Data in...
Hitachi, Ltd. OSS Solution Center.
 
PDF
ICONIQ State of AI Report 2025 - The Builder's Playbook
Razin Mustafiz
 
PPTX
MARTSIA: A Tool for Confidential Data Exchange via Public Blockchain - Pitch ...
Michele Kryston
 
PPTX
Smarter Governance with AI: What Every Board Needs to Know
OnBoard
 
PPSX
Usergroup - OutSystems Architecture.ppsx
Kurt Vandevelde
 
PDF
DoS Attack vs DDoS Attack_ The Silent Wars of the Internet.pdf
CyberPro Magazine
 
PDF
Enhancing Environmental Monitoring with Real-Time Data Integration: Leveragin...
Safe Software
 
PDF
Darley - FIRST Copenhagen Lightning Talk (2025-06-26) Epochalypse 2038 - Time...
treyka
 
PDF
Hyderabad MuleSoft In-Person Meetup (June 21, 2025) Slides
Ravi Tamada
 
PDF
Pipeline Industry IoT - Real Time Data Monitoring
Safe Software
 
TrustArc Webinar - Navigating APAC Data Privacy Laws: Compliance & Challenges
TrustArc
 
Smart Factory Monitoring IIoT in Machine and Production Operations.pptx
Rejig Digital
 
99 Bottles of Trust on the Wall — Operational Principles for Trust in Cyber C...
treyka
 
01_Approach Cyber- DORA Incident Management.pptx
FinTech Belgium
 
Supporting the NextGen 911 Digital Transformation with FME
Safe Software
 
My Journey from CAD to BIM: A True Underdog Story
Safe Software
 
Proactive Server and System Monitoring with FME: Using HTTP and System Caller...
Safe Software
 
Practical Applications of AI in Local Government
OnBoard
 
How to Visualize the ​Spatio-Temporal Data Using CesiumJS​
SANGHEE SHIN
 
Bitkom eIDAS Summit | European Business Wallet: Use Cases, Macroeconomics, an...
Carsten Stoecker
 
Mastering Authorization: Integrating Authentication and Authorization Data in...
Hitachi, Ltd. OSS Solution Center.
 
ICONIQ State of AI Report 2025 - The Builder's Playbook
Razin Mustafiz
 
MARTSIA: A Tool for Confidential Data Exchange via Public Blockchain - Pitch ...
Michele Kryston
 
Smarter Governance with AI: What Every Board Needs to Know
OnBoard
 
Usergroup - OutSystems Architecture.ppsx
Kurt Vandevelde
 
DoS Attack vs DDoS Attack_ The Silent Wars of the Internet.pdf
CyberPro Magazine
 
Enhancing Environmental Monitoring with Real-Time Data Integration: Leveragin...
Safe Software
 
Darley - FIRST Copenhagen Lightning Talk (2025-06-26) Epochalypse 2038 - Time...
treyka
 
Hyderabad MuleSoft In-Person Meetup (June 21, 2025) Slides
Ravi Tamada
 
Pipeline Industry IoT - Real Time Data Monitoring
Safe Software
 

Performance and stability testing \w Gatling