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

Site Availability is for Everybody

stellacotton
February 12, 2016

Site Availability is for Everybody

stellacotton

February 12, 2016
Tweet

More Decks by stellacotton

Other Decks in Programming

Transcript

  1. Stella Cotton | @practice_cactus S I T E AVA I

    L A B I L I T Y I S F O R E V E RY B O D Y —
  2. Stella Cotton | @practice_cactus 1 . G E T S

    TA RT E D 2 . T U R N U P T H E V O L U M E 3 . E X P L O R E T H E R E S U LT S
  3. Getting Started: Stella Cotton | @practice_cactus (Yes, technically you are

    only DoS-ing yourself by running Apache Bench on a single machine but you can DDoS with other tools and it sounded funnier. ¯\_(π)_/¯ ) Prepare
  4. Turning Up the Volume: Stella Cotton | @practice_cactus Total Customers

    in Line Your App + Load Arrival
 rate How long it takes to check out = x
  5. Turning Up the Volume: Stella Cotton | @practice_cactus Mean response

    time Your App + Load Mean # in system Mean throughput =
  6. Turning Up the Volume: Stella Cotton | @practice_cactus 1. Proxy

    Server 2. Application Server 3. Database Your App + Load
  7. Turning Up the Volume: Stella Cotton | @practice_cactus Your App

    + Load Proxy Server User Visits Your Site (Yay!) Firewall
  8. Turning Up the Volume: Stella Cotton | @practice_cactus Your App

    + Load Application Server Proxy Server User Visits Your Site (Yay!) Firewall
  9. Turning Up the Volume: Stella Cotton | @practice_cactus Your App

    + Load Proxy Server Application Server (Master Process) Worker (Child Process) Worker (Child Process) Worker (Child Process)
  10. Turning Up the Volume: Stella Cotton | @practice_cactus Your App

    + Load Proxy Server Application Server (Master Process) Database Worker (Child Process) Worker (Child Process) Worker (Child Process)
  11. Turning Up the Volume: Stella Cotton | @practice_cactus User file

    descriptor limits: ulimit -Hn ulimit -Sn Your OS + Load
  12. Turning Up the Volume: Stella Cotton | @practice_cactus Estimating user

    file limit numbers: • Each file is ~ 1 k of memory • Don’t allocate more than 10% of memory to files • So, approximately 100 file descriptors for every MB of RAM Your OS + Load
  13. Turning Up the Volume: Stella Cotton | @practice_cactus Adjust the

    System Limit: vi /etc/sysctl.conf with fs.file-max = 70000 Your OS + Load
  14. Turning Up the Volume: Stella Cotton | @practice_cactus Adjust the

    User Limit # vi /etc/security/limits.conf with yourusername soft no file 10000 yourusername hard no file 30000 Your OS + Load H T T P : / / W W W. C Y B E R C I T I . B I Z / FA Q / L I N U X - U N I X - N G I N X - T O O - M A N Y- O P E N - F I L E S /
  15. Turning Up the Volume: Stella Cotton | @practice_cactus Adjust the

    Proxy Server e.g. NGINX worker_rlimit_nofile 30000; Your OS + Load
  16. Turning Up the Volume: Stella Cotton | @practice_cactus Server recommendations

    
 for OS Tuning 
 H T T P : / / U N I C O R N . B O G O M I P S . O R G / T U N I N G . H T M L Your OS + Load
  17. Stella Cotton | @practice_cactus Exploring Your Results L I M

    I TAT I O N S O N T H E H O S T M A C H I N E
  18. Exploring Your Results: Stella Cotton | @practice_cactus Transaction Tracing H

    T T P S : / / D O C S . N E W R E L I C . C O M / D O C S / A P M / T R A N S A C T I O N S / T R A N S A C T I O N - T R A C E S / T R A N S A C T I O N - T R A C E S
  19. Exploring Your Results: Stella Cotton | @practice_cactus Slow Query Log

    H T T P : / / D E V. M Y S Q L . C O M / D O C / R E F M A N / 5 . 7 / E N / S L O W - Q U E RY- L O G . H T M L Database Woes
  20. Stella Cotton | @practice_cactus O T H E R L

    O A D T E S T I N G T O O L S
  21. Other Load Testing Tools Stella Cotton | @practice_cactus • Siege

    + Bombard • Bees with Machine Guns • JMeter + Ruby JMeter • ..and many more!
  22. Stella Cotton | @practice_cactus F R A M E W

    O R K F O R C U R I O S I T Y