$30 off During Our Annual Pro Sale. View Details »

Scaling CANDDi

Scaling CANDDi

coldclimate

July 29, 2013
Tweet

More Decks by coldclimate

Other Decks in Technology

Transcript

  1. Scaling CANDDi
    oli wood @coldclimate

    View Slide

  2. history

    View Slide

  3. measure things that
    matter

    View Slide

  4. back of a fag packet if
    good enough

    View Slide

  5. have somewhere to
    test which is not live

    View Slide

  6. use realistic data

    View Slide

  7. ab/siege +
    ec2 instances

    View Slide

  8. there are no silver
    bullets

    View Slide

  9. aim for a silver
    shotgun cartridge

    View Slide

  10. define the scenarios

    View Slide

  11. build a pipeline view

    View Slide

  12. identify symptoms
    but solve problems

    View Slide

  13. symptoms are what
    you can see

    View Slide

  14. problems are what
    you can solve

    View Slide

  15. bad new:
    the problem is your
    code

    View Slide

  16. good news:
    thus you can fix it

    View Slide

  17. do less big things
    less often

    View Slide

  18. do frequent things
    much faster

    View Slide

  19. avoid waiting

    View Slide

  20. pull less data

    View Slide

  21. cache the painful
    things

    View Slide

  22. cache: in memory

    View Slide

  23. cache:
    redis/memcache

    View Slide

  24. cache: url/browser
    cache

    View Slide

  25. hunt collisions

    View Slide

  26. use the tools

    View Slide

  27. iostat

    View Slide

  28. sar -P

    View Slide

  29. strace -p

    View Slide

  30. iftop

    View Slide

  31. xdebug + webgrind

    View Slide

  32. statsd

    View Slide

  33. mongotop

    View Slide

  34. mongosniff

    View Slide

  35. tail -100000 mongodb.
    log | awk -F' ' '{print
    $NF}' | grep ms$ | sed
    's/ms//g' |sort -n | tail
    -20 | xargs -I {} grep {}
    ms$ mongodb.log

    View Slide

  36. and the big gestures

    View Slide

  37. nginx

    View Slide

  38. nodejs

    View Slide

  39. redis

    View Slide

  40. aim: loosely coupled
    components which
    are horizontally
    scalable both on box
    and by box

    View Slide

  41. BULLSHIT

    View Slide

  42. aim: fast enough for
    medium term
    business needs

    View Slide

  43. aim: not to waste time
    in a geek circle jerk

    View Slide

  44. result: 10x the
    throughput

    View Slide

  45. result: 2000 non-
    trivial inbound events
    a second

    View Slide

  46. good luck

    View Slide