SlideShare a Scribd company logo
Load testing
in Zonky
Light introduction to
Gatling.io
Petr Vlček
Traditional solutions
● We want to tackle our performance issues with performance testing tools
● Traditional performance testing tools have some issues though
Complex GUI
Oh no, I want my code
back!
● Too many features
● Scripted invisible logic
● Not reusable
● Refactoring?
Versioning is painful
What has changed actually?
Performance of 1 user = 1 thread approach
50 JVM THREADS
Performance of 1 user = 1 thread approach
200 JVM THREADS
Gatling
● Describe load tests with code
○ just as unit tests, integration tests, REST tests, etc.
○ familiar to devs
○ versioning is easy (Git, peer review with pull requests, ...)
● Simple Scala DSL
● Tech under the hood
○ Akka - framework using message-actor pattern
○ Netty - non-blocking IO
● More efficient - can simulate more paralel users with less threads
Gatling
● Generates beautiful HTML
reports out-of-the-box
● or reports live data to Graphite
Defining a simple sunny day
scenario
1. Access Zonky marketplace page as an
anonymous user to see which loans are
available for investment
1 user, 1 HTTP request
Coding the simple simulation
● Configure server URL and default
HTTP headers (10-12)
● Define a scenario (14) executing
one step (15) which does a HTTP
GET request to /loans/marketplace
(17) and checks that response was
200 OK (18). After that wait for 5
seconds (20).
● Execute scenario (22) with 1 virtual
user (21) injected immediately after
start
Basic concepts - Scenario
● Represents user’s behavior - a workflow that a virtual user will follow
● Sequence of steps (exec)
● Thinking time simulation (pause)
● Grouping steps (group)
Basic concepts - Virtual user
● Represents a distinct user, each one has its own data or maybe has
different behavior
● Modelled as an Akka message passed along Akka Actors backing each step
in a scenario workflow
Basic concepts - Simulation
● Description of a load test
○ how many users (possibly with different scenarios) will run
○ which scenarios will they execute
○ how new users will be injected into simulation
● Users are injected to a simulation using different injection profiles
Injecting virtual users into simulation
● nothingFor - do not add any users for given duration
● atOnceUsers - add given number of users immediately
● rampUsers - add given number of users with linear ramp over given duration
● constantUsersPerSec - add users at a constant rate, defined by number of users per sec
● rampUsersPerSec - inject a random number of users per second over given duration
● splitUsers - repeat an injection step separated by pauses until given number of users is
reached
● heavisideUsers - Injects a given number of users following a smooth approximation over a
given duration
● See http://gatling.io/docs/current/cheat-sheet/
Injecting virtual users into simulation - example
Basic concepts - Session
● Each virtual user is backed by a session (modelled as an Akka message)
● State holder where data can be injected or captured from a step and can be
accessed in subsequent steps
● Session objects are immutable! set and setAll methods return new instances,
use chaining when setting more attributes
Basic concepts - Feeders
● Inject data from external source into a session of a virtual user
○ authentication data, various input data, …
● Sources
○ Scala data structures - Seq, Array
■ implicit iteration methods - queue, random, shuffle, circular
○ CSV files
○ JSON files
○ JDBC
○ Redis
● Conversion - convert raw data from feeder
● Data files location configurable in gatling.conf (gatling.core.directory.data),
default location is ${resource_root}/data
● See http://gatling.io/docs/current/session/feeder/#feeder for more examples
Feeders - example
Basic concepts - Checks
● Checks can be used to verify that a server response meets given conditions
○ Status is 200
○ HTTP header is present and matches a regex expression
○ response time in millis is lower than …
○ response body equals …
● Information from response can be parsed and saved to a user session
○ Parse response (JSON), use JSONPath to locate an attribute in the response
○ Extract data from response (find, findAll, findRandom, count)
○ Transform data from response (provide transforming lambda function)
○ Validate data from response (is, not, exists, notExists, in(sequence), optional)
■ RawFileBody, ElFileBody
○ Save, optional step, store parsed information as a session attribute for further steps
● See http://gatling.io/docs/current/http/http_check/#http-check
Basic concepts - Assertions
● Defines acceptance criteria on Gatling statistics (assertion fail = test fail)
● Scopes - global, forAll, details
● Statistics - responseTime, allRequests, failedRequests, successfulRequests,
requestsPerSec
● Conditions - lessThan, greaterThan, between, is, in
● See http://gatling.io/docs/current/general/assertions/#assertions
Passing parameters with system properties
Our infrastructure - AWS
Jenkins
Amazon
Web Services
Jenkins
Jenkins
JenkinsLoad generator
(ec2 instance)
Zonky API
Monitoring
tools
1
2
3
4
Uses Gatling AWS Maven plugin,
https://github.com/electronicarts/gatli
ng-aws-maven-plugin
1. Spin up (or use existing)
load generators in AWS,
distribute test package
2. Execute tests and generate
load on Zonky API
3. Collect performance metrics
with monitoring tools (New
Relic, Grafana, etc.)
4. Collect data for Gatling
report from all load
generators and compile
HTML report
Our infrastructure - Jenkins
● Gatling plugin
○ Performance
trends
○ Report viewer
● All jobs on
Performance tab
Wait, … that’s so 2016 ?!
3 years later ...
Scaling out perf tests with AWS Fargate
● AWS Fargate = serverless Docker runtime environment managed by Amazon
● Pros
○ Easy setup, ideal for small startups, drop-and-run your Docker image
○ No need to provision your own EC2 machines and tear them down after the test
○ You pay only for time when load generators are running
● Cons
○ Higher price per hour
○ Limits
■ max. 50 concurrently running tasks, contact support for raising the limit
■ possibly network performance,
https://stormforger.com/blog/2018/06/04/aws-fargate-network-performance/
■ no persistent local storage for tasks
Demo - AWS Fargate + Gatling + ELK stack
● Build
○ Gatling tests as a single executable jar file
○ Docker image with jar file baked in, executed as a task in Fargate, or locally ...
● Deployment
○ Logstash as a Fargate service
○ Fargate task definitions for Gatling load generators
● Runtime
○ Spin up to 50 load generators in Fargate, generators destroyed automatically after they finish
○ Collect data through Logstash to Elastic Search and copy simulation.log to S3 on finish
○ Compile final report from collected simulation.log files
Source code
● https://github.com/petrvlcek/gatling-demo
○ load generator
○ Docker configuration
○ scripts for running in AWS Fargate
● https://github.com/petrvlcek/gatling-logstash
○ OSS Logstash with pipeline configuration for Gatling
What to test and when
● One does not simply write performance tests
for everything
○ it’s expensive and pointless
○ you can’t predict user’s behavior
● OODA loop
○ Observe - know what’s happening in your system (monitoring, logs, analytics)
○ Orientate - identify hot-spots/bottlenecks in your system based on collected data
○ Decide - prioritize
○ Act - fix critical bottlenecks and validate with performance tests
Final thoughts
● Performance tests are tests like any other
○ coded by devs
○ no departments or expert teams are needed, trust your devops
● Integrate them to your CI/CD pipeline
○ trends/regression
○ acceptance criteria
● Decide what to test after observing your users and data from your monitoring
Load testing in Zonky with Gatling

More Related Content

What's hot

Balisage - EXPath - A practical introduction
Balisage - EXPath - A practical introductionBalisage - EXPath - A practical introduction
Balisage - EXPath - A practical introductionFlorent Georges
 
Java Memory Descreption
Java Memory DescreptionJava Memory Descreption
Java Memory Descreption
shohan_slideshare
 
Practical Experience with Automation Tools by Tim Walsh (Archivematica Camp B...
Practical Experience with Automation Tools by Tim Walsh (Archivematica Camp B...Practical Experience with Automation Tools by Tim Walsh (Archivematica Camp B...
Practical Experience with Automation Tools by Tim Walsh (Archivematica Camp B...
Artefactual Systems - Archivematica
 
Using Grails to power your electric car
Using Grails to power your electric carUsing Grails to power your electric car
Using Grails to power your electric car
Marco Pas
 
Balisage - EXPath Packaging
Balisage - EXPath PackagingBalisage - EXPath Packaging
Balisage - EXPath Packaging
Florent Georges
 
Automation tools: making things go... (March 2019)
Automation tools: making things go... (March 2019)Automation tools: making things go... (March 2019)
Automation tools: making things go... (March 2019)
Artefactual Systems - Archivematica
 
Analyzing Java Applications Using Thermostat (Omair Majid)
Analyzing Java Applications Using Thermostat (Omair Majid)Analyzing Java Applications Using Thermostat (Omair Majid)
Analyzing Java Applications Using Thermostat (Omair Majid)
Red Hat Developers
 
Introduction to the Archivematica API (September 2018)
Introduction to the Archivematica API (September 2018)Introduction to the Archivematica API (September 2018)
Introduction to the Archivematica API (September 2018)
Artefactual Systems - Archivematica
 
Java variables and classes
Java variables and classesJava variables and classes
Java variables and classes
KadarkaraiSelvam
 
Load testing with gatling
Load testing with gatlingLoad testing with gatling
Load testing with gatlingChris Birchall
 
Debugging Your Production JVM
Debugging Your Production JVMDebugging Your Production JVM
Debugging Your Production JVM
kensipe
 
Kernel Recipes 2014 - Performance Does Matter
Kernel Recipes 2014 - Performance Does MatterKernel Recipes 2014 - Performance Does Matter
Kernel Recipes 2014 - Performance Does Matter
Anne Nicolas
 
Java 9 sneak peek
Java 9 sneak peekJava 9 sneak peek
Java 9 sneak peek
Martin Toshev
 
Q4.11: Getting Started in LAVA
Q4.11: Getting Started in LAVAQ4.11: Getting Started in LAVA
Q4.11: Getting Started in LAVA
Linaro
 
Power tools in Java
Power tools in JavaPower tools in Java
Power tools in Java
DPC Consulting Ltd
 
All of the thing about Postman
All of the thing about PostmanAll of the thing about Postman
All of the thing about Postman
Alihossein shahabi
 
JavaCro'14 - Using WildFly core to build high performance web server – Tomaž ...
JavaCro'14 - Using WildFly core to build high performance web server – Tomaž ...JavaCro'14 - Using WildFly core to build high performance web server – Tomaž ...
JavaCro'14 - Using WildFly core to build high performance web server – Tomaž ...
HUJAK - Hrvatska udruga Java korisnika / Croatian Java User Association
 
Kafka monitoring and metrics
Kafka monitoring and metricsKafka monitoring and metrics
Kafka monitoring and metrics
Touraj Ebrahimi
 
M|18 Architectural Overview: MariaDB MaxScale
M|18 Architectural Overview: MariaDB MaxScaleM|18 Architectural Overview: MariaDB MaxScale
M|18 Architectural Overview: MariaDB MaxScale
MariaDB plc
 
Grand Central Dispatch - iOS Conf SG 2015
Grand Central Dispatch - iOS Conf SG 2015Grand Central Dispatch - iOS Conf SG 2015
Grand Central Dispatch - iOS Conf SG 2015
Ben Asher
 

What's hot (20)

Balisage - EXPath - A practical introduction
Balisage - EXPath - A practical introductionBalisage - EXPath - A practical introduction
Balisage - EXPath - A practical introduction
 
Java Memory Descreption
Java Memory DescreptionJava Memory Descreption
Java Memory Descreption
 
Practical Experience with Automation Tools by Tim Walsh (Archivematica Camp B...
Practical Experience with Automation Tools by Tim Walsh (Archivematica Camp B...Practical Experience with Automation Tools by Tim Walsh (Archivematica Camp B...
Practical Experience with Automation Tools by Tim Walsh (Archivematica Camp B...
 
Using Grails to power your electric car
Using Grails to power your electric carUsing Grails to power your electric car
Using Grails to power your electric car
 
Balisage - EXPath Packaging
Balisage - EXPath PackagingBalisage - EXPath Packaging
Balisage - EXPath Packaging
 
Automation tools: making things go... (March 2019)
Automation tools: making things go... (March 2019)Automation tools: making things go... (March 2019)
Automation tools: making things go... (March 2019)
 
Analyzing Java Applications Using Thermostat (Omair Majid)
Analyzing Java Applications Using Thermostat (Omair Majid)Analyzing Java Applications Using Thermostat (Omair Majid)
Analyzing Java Applications Using Thermostat (Omair Majid)
 
Introduction to the Archivematica API (September 2018)
Introduction to the Archivematica API (September 2018)Introduction to the Archivematica API (September 2018)
Introduction to the Archivematica API (September 2018)
 
Java variables and classes
Java variables and classesJava variables and classes
Java variables and classes
 
Load testing with gatling
Load testing with gatlingLoad testing with gatling
Load testing with gatling
 
Debugging Your Production JVM
Debugging Your Production JVMDebugging Your Production JVM
Debugging Your Production JVM
 
Kernel Recipes 2014 - Performance Does Matter
Kernel Recipes 2014 - Performance Does MatterKernel Recipes 2014 - Performance Does Matter
Kernel Recipes 2014 - Performance Does Matter
 
Java 9 sneak peek
Java 9 sneak peekJava 9 sneak peek
Java 9 sneak peek
 
Q4.11: Getting Started in LAVA
Q4.11: Getting Started in LAVAQ4.11: Getting Started in LAVA
Q4.11: Getting Started in LAVA
 
Power tools in Java
Power tools in JavaPower tools in Java
Power tools in Java
 
All of the thing about Postman
All of the thing about PostmanAll of the thing about Postman
All of the thing about Postman
 
JavaCro'14 - Using WildFly core to build high performance web server – Tomaž ...
JavaCro'14 - Using WildFly core to build high performance web server – Tomaž ...JavaCro'14 - Using WildFly core to build high performance web server – Tomaž ...
JavaCro'14 - Using WildFly core to build high performance web server – Tomaž ...
 
Kafka monitoring and metrics
Kafka monitoring and metricsKafka monitoring and metrics
Kafka monitoring and metrics
 
M|18 Architectural Overview: MariaDB MaxScale
M|18 Architectural Overview: MariaDB MaxScaleM|18 Architectural Overview: MariaDB MaxScale
M|18 Architectural Overview: MariaDB MaxScale
 
Grand Central Dispatch - iOS Conf SG 2015
Grand Central Dispatch - iOS Conf SG 2015Grand Central Dispatch - iOS Conf SG 2015
Grand Central Dispatch - iOS Conf SG 2015
 

Similar to Load testing in Zonky with Gatling

Journey through high performance django application
Journey through high performance django applicationJourney through high performance django application
Journey through high performance django application
bangaloredjangousergroup
 
Crikeycon 2019 Velociraptor Workshop
Crikeycon 2019 Velociraptor WorkshopCrikeycon 2019 Velociraptor Workshop
Crikeycon 2019 Velociraptor Workshop
Velocidex Enterprises
 
Testing Django APIs
Testing Django APIsTesting Django APIs
Testing Django APIs
tyomo4ka
 
Find the bottleneck of your system
Find the bottleneck of your systemFind the bottleneck of your system
Find the bottleneck of your system
Jian-Hong Pan
 
Node.js Web Apps @ ebay scale
Node.js Web Apps @ ebay scaleNode.js Web Apps @ ebay scale
Node.js Web Apps @ ebay scale
Dmytro Semenov
 
Utopia Kindgoms scaling case: From 4 to 50K users
Utopia Kindgoms scaling case: From 4 to 50K usersUtopia Kindgoms scaling case: From 4 to 50K users
Utopia Kindgoms scaling case: From 4 to 50K users
Jaime Buelta
 
Utopia Kingdoms scaling case. From 4 users to 50.000+
Utopia Kingdoms scaling case. From 4 users to 50.000+Utopia Kingdoms scaling case. From 4 users to 50.000+
Utopia Kingdoms scaling case. From 4 users to 50.000+
Python Ireland
 
PGConf APAC 2018 - High performance json postgre-sql vs. mongodb
PGConf APAC 2018 - High performance json  postgre-sql vs. mongodbPGConf APAC 2018 - High performance json  postgre-sql vs. mongodb
PGConf APAC 2018 - High performance json postgre-sql vs. mongodb
PGConf APAC
 
Ledingkart Meetup #2: Scaling Search @Lendingkart
Ledingkart Meetup #2: Scaling Search @LendingkartLedingkart Meetup #2: Scaling Search @Lendingkart
Ledingkart Meetup #2: Scaling Search @Lendingkart
Mukesh Singh
 
An evening with Postgresql
An evening with PostgresqlAn evening with Postgresql
An evening with Postgresql
Joshua Drake
 
High performance json- postgre sql vs. mongodb
High performance json- postgre sql vs. mongodbHigh performance json- postgre sql vs. mongodb
High performance json- postgre sql vs. mongodb
Wei Shan Ang
 
Next Generation Automation in Ruckus Wireless
Next Generation Automation in Ruckus WirelessNext Generation Automation in Ruckus Wireless
Next Generation Automation in Ruckus WirelessDavid Ko
 
Your Java Journey into the Serverless World
Your Java Journey into the Serverless WorldYour Java Journey into the Serverless World
Your Java Journey into the Serverless World
Kamesh Sampath
 
Introduction to ZooKeeper - TriHUG May 22, 2012
Introduction to ZooKeeper - TriHUG May 22, 2012Introduction to ZooKeeper - TriHUG May 22, 2012
Introduction to ZooKeeper - TriHUG May 22, 2012
mumrah
 
NetflixOSS Open House Lightning talks
NetflixOSS Open House Lightning talksNetflixOSS Open House Lightning talks
NetflixOSS Open House Lightning talks
Ruslan Meshenberg
 
Intro to XPages for Administrators (DanNotes, November 28, 2012)
Intro to XPages for Administrators (DanNotes, November 28, 2012)Intro to XPages for Administrators (DanNotes, November 28, 2012)
Intro to XPages for Administrators (DanNotes, November 28, 2012)Per Henrik Lausten
 
Introduction to InfluxDB, an Open Source Distributed Time Series Database by ...
Introduction to InfluxDB, an Open Source Distributed Time Series Database by ...Introduction to InfluxDB, an Open Source Distributed Time Series Database by ...
Introduction to InfluxDB, an Open Source Distributed Time Series Database by ...
Hakka Labs
 
Testing kubernetes and_open_shift_at_scale_20170209
Testing kubernetes and_open_shift_at_scale_20170209Testing kubernetes and_open_shift_at_scale_20170209
Testing kubernetes and_open_shift_at_scale_20170209
mffiedler
 
PyGrunn2013 High Performance Web Applications with TurboGears
PyGrunn2013  High Performance Web Applications with TurboGearsPyGrunn2013  High Performance Web Applications with TurboGears
PyGrunn2013 High Performance Web Applications with TurboGears
Alessandro Molina
 
Socket programming, and openresty
Socket programming, and openrestySocket programming, and openresty
Socket programming, and openresty
Tavish Naruka
 

Similar to Load testing in Zonky with Gatling (20)

Journey through high performance django application
Journey through high performance django applicationJourney through high performance django application
Journey through high performance django application
 
Crikeycon 2019 Velociraptor Workshop
Crikeycon 2019 Velociraptor WorkshopCrikeycon 2019 Velociraptor Workshop
Crikeycon 2019 Velociraptor Workshop
 
Testing Django APIs
Testing Django APIsTesting Django APIs
Testing Django APIs
 
Find the bottleneck of your system
Find the bottleneck of your systemFind the bottleneck of your system
Find the bottleneck of your system
 
Node.js Web Apps @ ebay scale
Node.js Web Apps @ ebay scaleNode.js Web Apps @ ebay scale
Node.js Web Apps @ ebay scale
 
Utopia Kindgoms scaling case: From 4 to 50K users
Utopia Kindgoms scaling case: From 4 to 50K usersUtopia Kindgoms scaling case: From 4 to 50K users
Utopia Kindgoms scaling case: From 4 to 50K users
 
Utopia Kingdoms scaling case. From 4 users to 50.000+
Utopia Kingdoms scaling case. From 4 users to 50.000+Utopia Kingdoms scaling case. From 4 users to 50.000+
Utopia Kingdoms scaling case. From 4 users to 50.000+
 
PGConf APAC 2018 - High performance json postgre-sql vs. mongodb
PGConf APAC 2018 - High performance json  postgre-sql vs. mongodbPGConf APAC 2018 - High performance json  postgre-sql vs. mongodb
PGConf APAC 2018 - High performance json postgre-sql vs. mongodb
 
Ledingkart Meetup #2: Scaling Search @Lendingkart
Ledingkart Meetup #2: Scaling Search @LendingkartLedingkart Meetup #2: Scaling Search @Lendingkart
Ledingkart Meetup #2: Scaling Search @Lendingkart
 
An evening with Postgresql
An evening with PostgresqlAn evening with Postgresql
An evening with Postgresql
 
High performance json- postgre sql vs. mongodb
High performance json- postgre sql vs. mongodbHigh performance json- postgre sql vs. mongodb
High performance json- postgre sql vs. mongodb
 
Next Generation Automation in Ruckus Wireless
Next Generation Automation in Ruckus WirelessNext Generation Automation in Ruckus Wireless
Next Generation Automation in Ruckus Wireless
 
Your Java Journey into the Serverless World
Your Java Journey into the Serverless WorldYour Java Journey into the Serverless World
Your Java Journey into the Serverless World
 
Introduction to ZooKeeper - TriHUG May 22, 2012
Introduction to ZooKeeper - TriHUG May 22, 2012Introduction to ZooKeeper - TriHUG May 22, 2012
Introduction to ZooKeeper - TriHUG May 22, 2012
 
NetflixOSS Open House Lightning talks
NetflixOSS Open House Lightning talksNetflixOSS Open House Lightning talks
NetflixOSS Open House Lightning talks
 
Intro to XPages for Administrators (DanNotes, November 28, 2012)
Intro to XPages for Administrators (DanNotes, November 28, 2012)Intro to XPages for Administrators (DanNotes, November 28, 2012)
Intro to XPages for Administrators (DanNotes, November 28, 2012)
 
Introduction to InfluxDB, an Open Source Distributed Time Series Database by ...
Introduction to InfluxDB, an Open Source Distributed Time Series Database by ...Introduction to InfluxDB, an Open Source Distributed Time Series Database by ...
Introduction to InfluxDB, an Open Source Distributed Time Series Database by ...
 
Testing kubernetes and_open_shift_at_scale_20170209
Testing kubernetes and_open_shift_at_scale_20170209Testing kubernetes and_open_shift_at_scale_20170209
Testing kubernetes and_open_shift_at_scale_20170209
 
PyGrunn2013 High Performance Web Applications with TurboGears
PyGrunn2013  High Performance Web Applications with TurboGearsPyGrunn2013  High Performance Web Applications with TurboGears
PyGrunn2013 High Performance Web Applications with TurboGears
 
Socket programming, and openresty
Socket programming, and openrestySocket programming, and openresty
Socket programming, and openresty
 

Recently uploaded

Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus
 
RISE with SAP and Journey to the Intelligent Enterprise
RISE with SAP and Journey to the Intelligent EnterpriseRISE with SAP and Journey to the Intelligent Enterprise
RISE with SAP and Journey to the Intelligent Enterprise
Srikant77
 
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Globus
 
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology SolutionsProsigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns
 
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdfDominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
AMB-Review
 
How Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptxHow Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptx
wottaspaceseo
 
Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024
Paco van Beckhoven
 
Enhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdf
Enhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdfEnhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdf
Enhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdf
Jay Das
 
Corporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMSCorporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMS
Tendenci - The Open Source AMS (Association Management Software)
 
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Globus
 
Using IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New ZealandUsing IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New Zealand
IES VE
 
First Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User EndpointsFirst Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User Endpoints
Globus
 
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Anthony Dahanne
 
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Globus
 
Quarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden ExtensionsQuarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden Extensions
Max Andersen
 
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Globus
 
Enhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdfEnhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdf
Globus
 
Large Language Models and the End of Programming
Large Language Models and the End of ProgrammingLarge Language Models and the End of Programming
Large Language Models and the End of Programming
Matt Welsh
 
Enterprise Resource Planning System in Telangana
Enterprise Resource Planning System in TelanganaEnterprise Resource Planning System in Telangana
Enterprise Resource Planning System in Telangana
NYGGS Automation Suite
 
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
informapgpstrackings
 

Recently uploaded (20)

Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024
 
RISE with SAP and Journey to the Intelligent Enterprise
RISE with SAP and Journey to the Intelligent EnterpriseRISE with SAP and Journey to the Intelligent Enterprise
RISE with SAP and Journey to the Intelligent Enterprise
 
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
 
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology SolutionsProsigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology Solutions
 
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdfDominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
 
How Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptxHow Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptx
 
Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024
 
Enhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdf
Enhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdfEnhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdf
Enhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdf
 
Corporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMSCorporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMS
 
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
 
Using IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New ZealandUsing IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New Zealand
 
First Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User EndpointsFirst Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User Endpoints
 
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
 
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...
 
Quarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden ExtensionsQuarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden Extensions
 
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
 
Enhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdfEnhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdf
 
Large Language Models and the End of Programming
Large Language Models and the End of ProgrammingLarge Language Models and the End of Programming
Large Language Models and the End of Programming
 
Enterprise Resource Planning System in Telangana
Enterprise Resource Planning System in TelanganaEnterprise Resource Planning System in Telangana
Enterprise Resource Planning System in Telangana
 
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
 

Load testing in Zonky with Gatling

  • 1.
  • 2. Load testing in Zonky Light introduction to Gatling.io Petr Vlček
  • 3. Traditional solutions ● We want to tackle our performance issues with performance testing tools ● Traditional performance testing tools have some issues though
  • 4. Complex GUI Oh no, I want my code back! ● Too many features ● Scripted invisible logic ● Not reusable ● Refactoring?
  • 5. Versioning is painful What has changed actually?
  • 6. Performance of 1 user = 1 thread approach 50 JVM THREADS
  • 7. Performance of 1 user = 1 thread approach 200 JVM THREADS
  • 8. Gatling ● Describe load tests with code ○ just as unit tests, integration tests, REST tests, etc. ○ familiar to devs ○ versioning is easy (Git, peer review with pull requests, ...) ● Simple Scala DSL ● Tech under the hood ○ Akka - framework using message-actor pattern ○ Netty - non-blocking IO ● More efficient - can simulate more paralel users with less threads
  • 9. Gatling ● Generates beautiful HTML reports out-of-the-box ● or reports live data to Graphite
  • 10. Defining a simple sunny day scenario 1. Access Zonky marketplace page as an anonymous user to see which loans are available for investment 1 user, 1 HTTP request
  • 11. Coding the simple simulation ● Configure server URL and default HTTP headers (10-12) ● Define a scenario (14) executing one step (15) which does a HTTP GET request to /loans/marketplace (17) and checks that response was 200 OK (18). After that wait for 5 seconds (20). ● Execute scenario (22) with 1 virtual user (21) injected immediately after start
  • 12. Basic concepts - Scenario ● Represents user’s behavior - a workflow that a virtual user will follow ● Sequence of steps (exec) ● Thinking time simulation (pause) ● Grouping steps (group)
  • 13. Basic concepts - Virtual user ● Represents a distinct user, each one has its own data or maybe has different behavior ● Modelled as an Akka message passed along Akka Actors backing each step in a scenario workflow
  • 14. Basic concepts - Simulation ● Description of a load test ○ how many users (possibly with different scenarios) will run ○ which scenarios will they execute ○ how new users will be injected into simulation ● Users are injected to a simulation using different injection profiles
  • 15. Injecting virtual users into simulation ● nothingFor - do not add any users for given duration ● atOnceUsers - add given number of users immediately ● rampUsers - add given number of users with linear ramp over given duration ● constantUsersPerSec - add users at a constant rate, defined by number of users per sec ● rampUsersPerSec - inject a random number of users per second over given duration ● splitUsers - repeat an injection step separated by pauses until given number of users is reached ● heavisideUsers - Injects a given number of users following a smooth approximation over a given duration ● See http://gatling.io/docs/current/cheat-sheet/
  • 16. Injecting virtual users into simulation - example
  • 17. Basic concepts - Session ● Each virtual user is backed by a session (modelled as an Akka message) ● State holder where data can be injected or captured from a step and can be accessed in subsequent steps ● Session objects are immutable! set and setAll methods return new instances, use chaining when setting more attributes
  • 18. Basic concepts - Feeders ● Inject data from external source into a session of a virtual user ○ authentication data, various input data, … ● Sources ○ Scala data structures - Seq, Array ■ implicit iteration methods - queue, random, shuffle, circular ○ CSV files ○ JSON files ○ JDBC ○ Redis ● Conversion - convert raw data from feeder ● Data files location configurable in gatling.conf (gatling.core.directory.data), default location is ${resource_root}/data ● See http://gatling.io/docs/current/session/feeder/#feeder for more examples
  • 20. Basic concepts - Checks ● Checks can be used to verify that a server response meets given conditions ○ Status is 200 ○ HTTP header is present and matches a regex expression ○ response time in millis is lower than … ○ response body equals … ● Information from response can be parsed and saved to a user session ○ Parse response (JSON), use JSONPath to locate an attribute in the response ○ Extract data from response (find, findAll, findRandom, count) ○ Transform data from response (provide transforming lambda function) ○ Validate data from response (is, not, exists, notExists, in(sequence), optional) ■ RawFileBody, ElFileBody ○ Save, optional step, store parsed information as a session attribute for further steps ● See http://gatling.io/docs/current/http/http_check/#http-check
  • 21. Basic concepts - Assertions ● Defines acceptance criteria on Gatling statistics (assertion fail = test fail) ● Scopes - global, forAll, details ● Statistics - responseTime, allRequests, failedRequests, successfulRequests, requestsPerSec ● Conditions - lessThan, greaterThan, between, is, in ● See http://gatling.io/docs/current/general/assertions/#assertions
  • 22. Passing parameters with system properties
  • 23. Our infrastructure - AWS Jenkins Amazon Web Services Jenkins Jenkins JenkinsLoad generator (ec2 instance) Zonky API Monitoring tools 1 2 3 4 Uses Gatling AWS Maven plugin, https://github.com/electronicarts/gatli ng-aws-maven-plugin 1. Spin up (or use existing) load generators in AWS, distribute test package 2. Execute tests and generate load on Zonky API 3. Collect performance metrics with monitoring tools (New Relic, Grafana, etc.) 4. Collect data for Gatling report from all load generators and compile HTML report
  • 24. Our infrastructure - Jenkins ● Gatling plugin ○ Performance trends ○ Report viewer ● All jobs on Performance tab
  • 25. Wait, … that’s so 2016 ?!
  • 27. Scaling out perf tests with AWS Fargate ● AWS Fargate = serverless Docker runtime environment managed by Amazon ● Pros ○ Easy setup, ideal for small startups, drop-and-run your Docker image ○ No need to provision your own EC2 machines and tear them down after the test ○ You pay only for time when load generators are running ● Cons ○ Higher price per hour ○ Limits ■ max. 50 concurrently running tasks, contact support for raising the limit ■ possibly network performance, https://stormforger.com/blog/2018/06/04/aws-fargate-network-performance/ ■ no persistent local storage for tasks
  • 28. Demo - AWS Fargate + Gatling + ELK stack ● Build ○ Gatling tests as a single executable jar file ○ Docker image with jar file baked in, executed as a task in Fargate, or locally ... ● Deployment ○ Logstash as a Fargate service ○ Fargate task definitions for Gatling load generators ● Runtime ○ Spin up to 50 load generators in Fargate, generators destroyed automatically after they finish ○ Collect data through Logstash to Elastic Search and copy simulation.log to S3 on finish ○ Compile final report from collected simulation.log files
  • 29. Source code ● https://github.com/petrvlcek/gatling-demo ○ load generator ○ Docker configuration ○ scripts for running in AWS Fargate ● https://github.com/petrvlcek/gatling-logstash ○ OSS Logstash with pipeline configuration for Gatling
  • 30. What to test and when ● One does not simply write performance tests for everything ○ it’s expensive and pointless ○ you can’t predict user’s behavior ● OODA loop ○ Observe - know what’s happening in your system (monitoring, logs, analytics) ○ Orientate - identify hot-spots/bottlenecks in your system based on collected data ○ Decide - prioritize ○ Act - fix critical bottlenecks and validate with performance tests
  • 31. Final thoughts ● Performance tests are tests like any other ○ coded by devs ○ no departments or expert teams are needed, trust your devops ● Integrate them to your CI/CD pipeline ○ trends/regression ○ acceptance criteria ● Decide what to test after observing your users and data from your monitoring