dsling your system for scalability testing using gatling - dublin scala user group
DESCRIPTION
The power of Gatling is the DSL it provides to allow writing meaningful and expressive tests. We provide an overview of the framework, a description of their development environment and goals, and present their test results. Source code available https://github.com/lawlessc/random-response-timeTRANSCRIPT
GATLING
DSLing your System For Scalability Testing Using Gatling Sept 23 2014, Dublin Scala User Group
GATLING
Speaking for ourselves and not our employer
Thanks!
• The Team
• Gatling Walkthrough
• Example Results
• Our App - and what we need
• and a lab!
The Team
CHRIS LAWLESS
Code Wrangler Polygon creator
KEVIN YU WEI XIA
Code Wrangler
FERGAL CARROLL
Code Wrangler @phergalkarl
CIARAN Ó HUALLACHÁIN Code Wrangler
AMAN KOHLI Architect @akohli
BILL MONKS Leader in Chief
@billmonks
The Team
HACKENBUSHWe’re Not Experts
Enterprise Mobile
Many Users, Many Systems
• > 20k users
• ~ 20k systems (joke!)
Lots of different security access and systems
Device plurality
Many Locations, Many Networks
Gatling • http://gatling.io | https://
github.com/gatling/
• Built on Netty + Akka + Scala
• add to sbt -
libraryDependencies += "io.gatling.highcharts" % "gatling-charts-highcharts" % "2.0.0-RC5"
• Good start http://www.thoughtworks.com/insights/blog/gatling-take-your-performance-tests-next-level
Why Gatling
• Powerful, simple DSL scn.users(10).ramp(30).protocolConfig(httpConf)!
• Easy to add security and other elements
• Varying transport support
• HTTP
• Websockets
• JMS
• We found Jmeter fiddly.
Why Gatling (2)
• Great Reporting and Charting
• Active Users, Requests
• Over time
• See Example 1
• walk through Details and Global views
Anatomy of a Gatling Script
Example
Transport, and hostheader cfg
Example
Transport, and hostheader cfg
scenario name Req Name Method
endpoint
Example
Transport, and hostheader cfg
Making it a bit like flod
GITHUB.COM/SPUMKO/FLOD
$ flod -n 2000 -t 1500 -c 100..1000 -v http://target-place!!
GITHUB.COM/SPUMKO/FLOD
$ flod -n 2000 -t 1500 -c 100..1000 -v http://target-place!!
num req per batch
timeout
range of concurrent request per batch - “rate”
FLOD OUTPUT## 6k page results ec2-user@ip-10-199-51-233 node-hapi]$ flod -n 2000 -t 1500 -c 100..1000 -v http://localhost/loremipsum-6k-ish.htmlThis is Flod, version 0.2.2Copyright 2013 Walmart, http://github.com/spumko/flod!Benchmarking (hold on)...!Server Requests/sec Latency (ms) --------------------------------------- ------------ ---------------http://localhost/loremipsum-6k-ish.html 100 96.48 ± 18.54 http://localhost/loremipsum-6k-ish.html 200 164.24 ± 17.03 http://localhost/loremipsum-6k-ish.html 300 263.80 ± 62.44 http://localhost/loremipsum-6k-ish.html 400 359.61 ± 49.20 http://localhost/loremipsum-6k-ish.html 500 437.66 ± 58.69 http://localhost/loremipsum-6k-ish.html 600 481.29 ± 120.04http://localhost/loremipsum-6k-ish.html 700 606.74 ± 114.45http://localhost/loremipsum-6k-ish.html 800 555.08 ± 133.74http://localhost/loremipsum-6k-ish.html 900 674.08 ± 190.91http://localhost/loremipsum-6k-ish.html 1000 763.27 ± 69.25
## running with high timeout - doubling responses times vs nginx direct [ec2-user@ip-10-199-51-233 node-hapi]$ ../node_modules/flod/bin/flod -n 2000 -t 4500 -c 100..1000 -v http://localhost:8000This is Flod, version 0.2.2Copyright 2013 Walmart, http://github.com/spumko/flod!Benchmarking (hold on)...!Server Requests/sec Latency (ms) --------------------- ------------ ----------------http://localhost:8000 100 200.55 ± 39.40 http://localhost:8000 200 389.54 ± 67.39 http://localhost:8000 300 558.14 ± 112.57 http://localhost:8000 400 777.09 ± 160.01 http://localhost:8000 500 970.61 ± 305.76 http://localhost:8000 600 1032.37 ± 274.44http://localhost:8000 700 1216.49 ± 249.94http://localhost:8000 800 1483.31 ± 690.64http://localhost:8000 900 1559.54 ± 805.31http://localhost:8000 1000 1909.23 ± 845.81
NQF (not quite Flod)
Results
Random Wait Test• 100 users, 100 invocations each
• ramp to 100 users over 20 seconds
• Tests took 1 minute to run
• 10k requests
Users over Execution
Response Time
Requests and Responses per Second
Our ApplicationAnd what we need
THE REFLEKTOR
Security Pass
Employee DevicesSensors
The Physical World
Security Services
AuthZAuthN
…
Eventing Engine Bridge
Payment Services
Access Services
Printing Services
App Services and Resources
the ReflektorBridge and New Services
thePROXY First Release
THE FLOW
• The Protocol
• Security - Gateway Access
• Federated Identity - kinda
PROTOCOLRequest
json body
target
headers
body/post-data
loginfo
request = { URL = "http://www.citigroup.net/", method = "GET", timeout = 19500, clientInfo = { identifier = “…E”, model = "iPad Simulator", systemName = "iPhone OS", systemVersion = "7.1", }, headers = { Accept = "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", Cookie = "CGPLNG=ENG; JSESSIONID_CGNR3=..”, "User-Agent" = "Mozilla/5.0 (iPad; CPU OS 7_1 like Mac OS X) AppleWebKit/537.51.2 (KHTML, like Gecko) Mobile/11D167" }, logEntries = [ { URL = “https://cinternal.site/target/fooa”, downstreamDuration = 656, httpMethod = "GET", roundtripDuration = 3461, statusCode = 200 } ] }
RESPONSE body = “<base64>", code = 200, duration = 31, headers = { "Accept-Ranges" = [ "bytes" ], "Content-Length" = [ 225 ], "Content-Type" = [ "text/html" ], Date = [ "Thu, 29 May 2014 15:28:29 GMT" ], Etag = [ "\"e1-4e50c74f\"" ], "Last-Modified" = [ "Sun, 21 Aug 2011 08:52:31 GMT" ] }, message = "OK"}
– Anon.
Any Questions?
Lab
Invocation
• Fixed Endpoint
• http://cakohli.local:9001/waitfor/500
• Random Endpoint
• http://cakohli.local:9001/wait
• Interleave
Thank you Scala Dublinand @gilttech and @greheine and Joe McCarthy (@jmcarthy99) and
@nounproject
NOUN PROJECTS THANKS
Smartphone designed by James Fenton from the Noun Project ! Creative Commons – Attribution (CC BY 3.0) Identification designed by Mark Shorter from the Noun Project Ibeacon designed by Stéphanie Rusch from the Nount Project ! Creative Commons – Attribution (CC BY 3.0) Arduino designed by uizin from the Noun Project !