Upgrade to Pro — share decks privately, control downloads, hide ads and more …

A Locust Storm Is A Good Thing!

A Locust Storm Is A Good Thing!

Given at Stir Trek 2016

Have you ever wondered what is involved in doing load testing of web applications? What if you had to support 100,000 simultaneous users on Day 0? Do you have to integrate with 3rd party services? How do you strategically isolate and test those dependencies? What do you do when your tests reveal performance problems? Join us in a talk about web load testing using open source tools, the AWS cloud, dependency isolation, DB profiling, OS tuning, and not being targeted as a botnet.

stevenjackson

May 06, 2016
Tweet

More Decks by stevenjackson

Other Decks in Programming

Transcript

  1. A Favor? • Something you would change • Something you

    would NOT change • Something you found surprising • Something you found boring
  2. • How to start? • Why Locust? • How to

    deal with problems in the architecture? • Make an argument for starting load testing early • Tell a compelling story Goals
  3. • .realtor starts - Feb 2014 • Load Test start

    - 15 Sep 2014 • Soft Launch - 20 Oct 2014 • Launch - 23 Oct 2014 Timeline
  4. Send Emails DNS Mail Forwarding Payment Processor CREA Membership NAR

    Membership Registrar Hosted Website System Architecture
  5. NAR Membership System System Send Emails DNS Mail Forwarding Payment

    Processor CREA Membership Registrar Hosted Website Prioritizing Dependencies
  6. Fake Member Service
 Sinatra System System Fake DNS
 Sinatra Fake

    Registrar
 EventMachine Fake Payment
 Sinatra Stubbing Dependencies
  7. Why Locust? • Could interact with Rails CSRF tokens •

    Could execute end-to-end user interaction with sessions and cookies • Expands to multiple slaves to increase load capacity • Allows for distributed user paths based on percentages
  8. Methodology • Start Small (1000 simultaneous users) • Gather data

    • Grow infrastructure as we hit bottlenecks
  9. • Compression = YES, please • Serve static assets directly

    • Reverse proxy (proxy_pass) the rest to unicorn
  10. worker_processes 32 worker_rlimit_nofile 65536 use epoll worker_connections 65536 upstream realtor_unicorn

    { server unix:/tmp/realtor.sock fail_timeout=0; } keepalive_requests 0 proxy_read_timeout proxy_write_timeout client_max_body_size Take a look at these nginx.conf sites-available/sitename
  11. rails_user hard nofile 65536 /etc/security/limits.conf • ulimits to max #

    Increase size of file handles and inode cache fs.file-max = 100000 /etc/sysctl.conf
  12. What did I learn? • Don’t wait so long to

    start load testing • The conversations drive new requirements • This stuff is hard to figure out under pressure • Too late to do big changes confidently
  13. 15

  14. Send Emails DNS Mail Forwarding Payment Processor CREA Membership NAR

    Membership Registrar Hosted Website System Architecture
  15. 08

  16. 07

  17. 06

  18. “How do I convince others to start earlier?” “How to

    do this cheaper?” “When should we start?”