Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

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

4,341 views

Published on

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

Published in: Technology
  • Dating for everyone is here: ♥♥♥ http://bit.ly/2ZDZFYj ♥♥♥
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • Sex in your area is here: ♥♥♥ http://bit.ly/2ZDZFYj ♥♥♥
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here

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

  1. 1. GATLING
  2. 2. GATLING DSLing your System For Scalability Testing Using Gatling Sept 23 2014, Dublin Scala User Group
  3. 3. Speaking for ourselves and not our employer
  4. 4. Thanks! • The Team • Gatling Walkthrough • Example Results • Our App - and what we need • and a lab!
  5. 5. The Team
  6. 6. CHRIS LAWLESS Code Wrangler Polygon creator KEVIN YU WEI XIA Code Wrangler CIARAN Ó HUALLACHÁIN Code Wrangler FERGAL CARROLL Code Wrangler @phergalkarl AMAN KOHLI Architect @akohli BILL MONKS Leader in Chief @billmonks The Team
  7. 7. HACKENBUSH We’re Not Experts
  8. 8. Enterprise Mobile Many Users, Many Systems • > 20k users • ~ 20k systems (joke!) Lots of different security access and systems Device plurality Many Locations, Many Networks
  9. 9. 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
  10. 10. 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.
  11. 11. Why Gatling (2) • Great Reporting and Charting • Active Users, Requests • Over time • See Example 1 • walk through Details and Global views
  12. 12. Anatomy of a Gatling Script
  13. 13. Example Transport, and host header cfg
  14. 14. Example Transport, and host header cfg endpoint scenario name Req Name Method
  15. 15. Example Transport, and host header cfg
  16. 16. Making it a bit like flod
  17. 17. GITHUB.COM/SPUMKO/FLOD $ flod -n 2000 -t 1500 -c 100..1000 -v http://target-place ! !
  18. 18. GITHUB.COM/SPUMKO/FLOD num req per batch range of concurrent request per batch - $ flod -n 2000 -t 1500 -c 100..1000 -v http://target-place ! ! timeout “rate”
  19. 19. 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.html This is Flod, version 0.2.2 Copyright 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.04 http://localhost/loremipsum-6k-ish.html 700 606.74 ± 114.45 http://localhost/loremipsum-6k-ish.html 800 555.08 ± 133.74 http://localhost/loremipsum-6k-ish.html 900 674.08 ± 190.91 http://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:8000 This is Flod, version 0.2.2 Copyright 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.44 http://localhost:8000 700 1216.49 ± 249.94 http://localhost:8000 800 1483.31 ± 690.64 http://localhost:8000 900 1559.54 ± 805.31 http://localhost:8000 1000 1909.23 ± 845.81
  20. 20. NQF (not quite Flod)
  21. 21. Results
  22. 22. Random Wait Test • 100 users, 100 invocations each • ramp to 100 users over 20 seconds • Tests took 1 minute to run • 10k requests
  23. 23. Users over Execution
  24. 24. Response Time
  25. 25. Requests and Responses per Second
  26. 26. Our Application And what we need
  27. 27. Security Pass Sensors Employee Devices The Physical World THE REFLEKTOR Security Services AuthZ AuthN … Eventing Engine Bridge Payment Services Access Services Printing Services the Reflektor Bridge and New Services App Services and Resources
  28. 28. thePROXY First Release
  29. 29. THE FLOW • The Protocol • Security - Gateway Access • Federated Identity - kinda
  30. 30. PROTOCOL Request 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 } ] }
  31. 31. 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" }
  32. 32. Any Questions? – Anon.
  33. 33. Lab
  34. 34. Invocation • Fixed Endpoint • http://cakohli.local:9001/waitfor/500 • Random Endpoint • http://cakohli.local:9001/wait • Interleave
  35. 35. Thank you Scala Dublin and @gilttech and @greheine and Joe McCarthy (@jmcarthy99) and @nounproject
  36. 36. 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 !

×