dsling your system for scalability testing using gatling - dublin scala user group

36
GATLING

Upload: akohli

Post on 18-Jun-2015

3.173 views

Category:

Technology


5 download

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-time

TRANSCRIPT

Page 1: DSLing your System For Scalability Testing Using Gatling - Dublin Scala User Group

GATLING

Page 2: DSLing your System For Scalability Testing Using Gatling - Dublin Scala User Group

DSLing your System For Scalability Testing Using Gatling Sept 23 2014, Dublin Scala User Group

GATLING

Page 3: DSLing your System For Scalability Testing Using Gatling - Dublin Scala User Group

Speaking for ourselves and not our employer

Page 4: DSLing your System For Scalability Testing Using Gatling - Dublin Scala User Group

Thanks!

• The Team

• Gatling Walkthrough

• Example Results

• Our App - and what we need

• and a lab!

Page 5: DSLing your System For Scalability Testing Using Gatling - Dublin Scala User Group

The Team

Page 6: DSLing your System For Scalability Testing Using Gatling - Dublin Scala User Group

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

Page 7: DSLing your System For Scalability Testing Using Gatling - Dublin Scala User Group

HACKENBUSHWe’re Not Experts

Page 8: DSLing your System For Scalability Testing Using Gatling - Dublin Scala User Group

Enterprise Mobile

Many Users, Many Systems

• > 20k users

• ~ 20k systems (joke!)

Lots of different security access and systems

Device plurality

Many Locations, Many Networks

Page 9: DSLing your System For Scalability Testing Using Gatling - Dublin Scala User Group

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

Page 10: DSLing your System For Scalability Testing Using Gatling - Dublin Scala User Group

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.

Page 11: DSLing your System For Scalability Testing Using Gatling - Dublin Scala User Group

Why Gatling (2)

• Great Reporting and Charting

• Active Users, Requests

• Over time

• See Example 1

• walk through Details and Global views

Page 12: DSLing your System For Scalability Testing Using Gatling - Dublin Scala User Group

Anatomy of a Gatling Script

Page 13: DSLing your System For Scalability Testing Using Gatling - Dublin Scala User Group

Example

Transport, and hostheader cfg

Page 14: DSLing your System For Scalability Testing Using Gatling - Dublin Scala User Group

Example

Transport, and hostheader cfg

scenario name Req Name Method

endpoint

Page 15: DSLing your System For Scalability Testing Using Gatling - Dublin Scala User Group

Example

Transport, and hostheader cfg

Page 16: DSLing your System For Scalability Testing Using Gatling - Dublin Scala User Group

Making it a bit like flod

Page 17: DSLing your System For Scalability Testing Using Gatling - Dublin Scala User Group

GITHUB.COM/SPUMKO/FLOD

$ flod -n 2000 -t 1500 -c 100..1000 -v http://target-place!!

Page 18: DSLing your System For Scalability Testing Using Gatling - Dublin Scala User Group

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”

Page 19: DSLing your System For Scalability Testing Using Gatling - Dublin Scala User Group

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

Page 20: DSLing your System For Scalability Testing Using Gatling - Dublin Scala User Group

NQF (not quite Flod)

Page 21: DSLing your System For Scalability Testing Using Gatling - Dublin Scala User Group

Results

Page 22: DSLing your System For Scalability Testing Using Gatling - Dublin Scala User Group

Random Wait Test• 100 users, 100 invocations each

• ramp to 100 users over 20 seconds

• Tests took 1 minute to run

• 10k requests

Page 23: DSLing your System For Scalability Testing Using Gatling - Dublin Scala User Group

Users over Execution

Page 24: DSLing your System For Scalability Testing Using Gatling - Dublin Scala User Group

Response Time

Page 25: DSLing your System For Scalability Testing Using Gatling - Dublin Scala User Group

Requests and Responses per Second

Page 26: DSLing your System For Scalability Testing Using Gatling - Dublin Scala User Group

Our ApplicationAnd what we need

Page 27: DSLing your System For Scalability Testing Using Gatling - Dublin Scala User Group

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

Page 28: DSLing your System For Scalability Testing Using Gatling - Dublin Scala User Group

thePROXY First Release

Page 29: DSLing your System For Scalability Testing Using Gatling - Dublin Scala User Group

THE FLOW

• The Protocol

• Security - Gateway Access

• Federated Identity - kinda

Page 30: DSLing your System For Scalability Testing Using Gatling - Dublin Scala User Group

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 } ] }

Page 31: DSLing your System For Scalability Testing Using Gatling - Dublin Scala User Group

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"}

Page 32: DSLing your System For Scalability Testing Using Gatling - Dublin Scala User Group

– Anon.

Any Questions?

Page 33: DSLing your System For Scalability Testing Using Gatling - Dublin Scala User Group

Lab

Page 34: DSLing your System For Scalability Testing Using Gatling - Dublin Scala User Group

Invocation

• Fixed Endpoint

• http://cakohli.local:9001/waitfor/500

• Random Endpoint

• http://cakohli.local:9001/wait

• Interleave

Page 35: DSLing your System For Scalability Testing Using Gatling - Dublin Scala User Group

Thank you Scala Dublinand @gilttech and @greheine and Joe McCarthy (@jmcarthy99) and

@nounproject

Page 36: DSLing your System For Scalability Testing Using Gatling - Dublin Scala User Group

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 !