Load Testing with Gatling
Hat’s off for Stephane Landelle
Introduction 
Gatling 
Demo
Load testing? 
Checking the performance of your application 
under normal and peak load conditions.
Types of load tests 
● Capacity Test 
● Stress Test 
● Endurance Test
Capacity Test 
Goal: Determine how much load your system 
can hold
Stress Test 
Goal: Study system behavior in case of heavy 
load, during AND after
Endurance Test 
Goal: Validate system behavior after a long 
period of activity.
Performance What for? 
(from business POV) 
It’s all ‘bout the money! 
Conversion rates 
Platform costs
Results/page : 10 => 30 
➔ +500 ms 
➔ -20% pages seen
+100 ms 
➔ -1 % sales 
➔ Estimated loss: $160M/y
How? 
1.Define goals 
- Requirements 
2.Analyze 
- Data 
- Monitor 
3.Simulate 
- Behaviors 
- Injector 
4.Iterate!!!
Load testing tool 
Jmeter, The Grinder, LoadUI, 
Tsung, Locust, Load Runner, 
Rational, NeoLoad…
Issue #1 High Performance
1 user = 1 thread
50 Threads on a JVM
With 2000 threads
Blocking I/O
Threads? Waiting…
… and 
sleeping
Can you trust your results ? 
JMeter2.8 perftest, expecting 300 tr/sec
JMeter reference test with Gatling, 
expecting 300 tr/sec
Issue #2 Usability
Graphical User Interface
Issue #3 Maintainability
What was this change about?
Synchronous - Asynchronous 
1user=1 thread - Actor model 
Blocking I/O - Non blocking I/O
Be asynchronous, 
embrace the actor model
Use non-blocking I/O 
● Async HTTP Client 
● Netty
Scenario 
= Scala code 
= DSL
Demo
Use the rich DSL … 
Checks 
regex / css/ xpath/ jsonPath 
find / findAll/ count 
is / in / not / whatever 
Structures 
doIf/ repeat / during / asLongAs 
randomSwitch/ roundRobinSwitch 
Error handling 
tryMax/ exitBlockOnFail 
Feeders 
csv/ tsv/ jdbc
or write your own Scala code…
or use the Recorder
References 
http://gatling.io 
https://github.com/gatling
Thank You

Gatling