scaling continuous deployment etsy
play

Scaling Continuous Deployment @ Etsy Avleen Vig Staff Operations - PowerPoint PPT Presentation

Scaling Continuous Deployment @ Etsy Avleen Vig Staff Operations Engineer @avleen With much credit: Daniel Schauenberg: (@mrtazz) Statistics @avleen Statistics @avleen Our application Mostly monolithic @avleen Our application A


  1. Scaling Continuous 
 Deployment @ Etsy Avleen Vig Staff Operations Engineer 
 @avleen With much credit: Daniel Schauenberg: (@mrtazz)

  2. Statistics @avleen

  3. Statistics @avleen

  4. Our application Mostly monolithic @avleen

  5. Our application A few services too @avleen

  6. Our application Deploy frequency @avleen

  7. Our team Before.. @avleen

  8. Our team Today.. ..and that’s just a fraction! @avleen

  9. Deploying code The push train Item by decomodwalls @avleen

  10. Deploying code #push • IRC channel to organize push trains • Join a train if you want to deploy changes • Schedule is planned via the channel topic • First in the train is the driver @avleen

  11. Deploying code #push <prod> kseever* + jameslee | jpaul | avleen (c) @avleen

  12. Deploying code #push <prod> bateman* + krunal* + enorris* | tristan (c) + jameslee (c) + jlaster (c) | dawa + corey + sandosh + jklein + magera + seth_home + mpascual + nathan | bateman | russp (c) @avleen

  13. Deploying code Deployinator @avleen

  14. https://github.com/ etsy/deployinator @avleen

  15. Deploying code So what’s the problem? @avleen

  16. Deploying code So what’s the problem? • Deploy-time requests are not atomic • Weird limbo while syncing in- place • Limits on pushes-per-day • Long wait times @avleen

  17. Deploying code Um, limits per day? � • (push_queue_hours * 60) 
 minutes to deploy • At 15 mins/deploy, we get ~32 deploys per day - not enough! @avleen

  18. How can we scale it? Our options: • More code in each deploy • Allow concurrent deploys • Reduce deploy times • Make deploys atomic • Fork more concurrent rsyncs @avleen

  19. How can we scale it? More code in each deploy: • Also has limits • How many people can be in each push? • We found ~8 to be our limit for reducing wait times @avleen

  20. How can we scale it? Allow concurrent deploys: � • For config changes • Code on independent systems • The few services we have @avleen

  21. How can we scale it? Concurrent deploys: HELLO SPLIT QUEUES HELLO SPLIT QUEUES @avleen

  22. How can we scale it? Reduce deploy times: • Tweaks around rsync • Keep codebase in RAM (tmpfs) • Increase rsync concurrency • Reduce timeouts and retry intervals @avleen

  23. How can we scale it? Make deploys atomic: Yin Yang Active Docroot @avleen

  24. How can we scale it? Make deploys atomic: rsync Yin Yang Active Docroot @avleen

  25. How can we scale it? Make deploys atomic: Yin Yang Active Docroot @avleen

  26. How can we scale it? Make deploys atomic: Yin Yang Active Docroot @avleen

  27. How can we scale it? Make deploys atomic: • Not so trivial • PHP opcache problems • include_path troubles • Swapping symlinks mid-request @avleen

  28. http://github.com/ etsy/mod_realdoc @avleen

  29. How can we scale it? Make deploys atomic, mod_realdoc: � • Apache post_read_request hook • Whole request works on realpath of docroot • Caches realpath for 2s @avleen

  30. http://github.com/ etsy/incpath @avleen

  31. How can we scale it? Make deploys atomic, incpath: � • PHP extension • Updates a portion of include_path • $_SERVER[“DOCUMENT_ROOT”] @avleen

  32. Infrastructure @avleen

  33. Scaling infrastructure Before: Deploy 
 Deployinator Production 
 Host Servers @avleen

  34. Scaling infrastructure After: Deploy 
 Deployinator Production 
 Host Servers Deploy 
 Host @avleen

  35. Results! @avleen

  36. Results! What did we gain? � • No need to restart apache • Entire deploy in one push • Opcode cache stays warm! @avleen

  37. Results! Push frequency � • (push_queue_hours * 60) 
 minutes to deploy • Still ~15mins/deploy: 
 Much more code going out 
 Tests still run fast 
 Less time waiting to deploy @avleen

  38. Q&A @avleen

Recommend


More recommend