Ruby Proxies for Scale, Performance, and Monitoring - GoGaRuCo - igvita.com

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

0 comments

Post a comment

    Post a comment
    Embed Video
    Edit your comment Cancel

    Notes on slide 1

    Wonderful, wonderful world in the context of building and using Ruby proxy servers for scale, performance and monitoring.

    22 Favorites

    Ruby Proxies for Scale, Performance, and Monitoring - GoGaRuCo - igvita.com - Presentation Transcript

    1. Ruby Proxies for Scale, Performance and Monitoring Ilya Grigorik CTO / AideRSS Event-Driven Architectures @igrigorik #meshu #eda http://bit.ly/eda
    2. postrank.com/topic/ruby The slides… Twitter My blog
      • Proxy Love
      • Myth: Slow Frameworks
      “ Rails, Django, Seaside, Scala…” cant scale.
      • The Proxy Solution
      • The “More” Proxy Solution
      • Transparent, Cut-Through Proxy
      Transparent
      • Transparent Proxy = Scalability Power Tool
      90% use case
    3. Proxies for Monitoring, Performance and Scale welcome to the wonderful world of intercepting, caching, … , proxy servers
    4. Problem: Staging Environment Production Simulated User
    5. “ Representative Load / Staging” Duplication Simulating traffic?
    6. Staging fail. Profile of queries has changed Fail Load on production has changed Fail Parallel environment Fail Slower release cycle Fail
    7. Replay log data, rinse, repeat github.com/igrigorik/autoperf
      • Benchmarking Proxy
      • flash of the obvious
      Real (production) traffic Duplex Ruby Proxy, FTW!
    8. Transparent Duplex Proxy, FTW
    9. Same response, different turnaround time Different response body!
      • github.com/igrigorik/em-proxy
      Duplex Ruby Proxy, FTW!
      • EM-Proxy Workflow
      1. Accept connection - Connect & Forward to Production - Connect & Forward to Staging 2. Stream response to client from Production - Buffer response from Staging 3. Run “Processor / Analyzer” once both return
    10. Ruby EventMachine crash course EM::Connection #receive_data - new data ready for processing #unbind - connection terminated #connection_completed - connected
    11. Duplex incoming data
    12. Forward Production Response Analyze Results
    13. Open connection to application server
    14. Buffer until connected
    15. Pass response to Duplex Notify when done
    16. Analyze Time, Response…
    17. Analyze Time, Response… Response Time
    18. Cute, right? but so what…
    19. %w[ <Transparent> Intercepting Caching … ] solution for every problem
    20. Validating Proxy easy, real-time diagnostics Woops!
    21. Who said you’re not allowed to touch the data? Intercepting Proxy for those hard-to-reach spots
    22. SMTP / Mail: inject SPAM detection De(encrypt): stream data MySQL: inject sharding logic Intercepting Proxy for those hard-to-reach spots
    23. @PostRank: Beanstalkd + Ruby Proxy because RAM is still expensive
      • Beanstalkd Math
      ~ 93 Bytes of overhead per job ~300 Bytes of data / job x 80,000,000 jobs in memory ~ 30 GB of RAM = 2 X-Large EC2 instances Oi, expensive!
      • Extending Beanstalkd
      Observations: 1. Each job is rescheduled several times 2. > 95% are scheduled for > 3 hours into the future 3. Beanstalkd does not have overflow page-to-disk Memory is wasted… We’ll add it ourselves!
    24. @PostRank: “Chronos Scheduler” 1 “Medium” EC2 Instance Intercepting Proxy
    25. Extend the protocol Chronos Scheduler Beanstalkd persistence Process incoming data Buffer “SCHEDULE” requests, otherwise forward
    26. Archive to MySQL Chronos Scheduler Beanstalkd persistence Buffer “SCHEDULE”
    27. @PostRank: “Chronos Scheduler” Extend the protocol ARCHIVE RESERVE, … 10 line patch to client: queue.archive(job)
    28. @PostRank: “Chronos Scheduler” ~79,000,000 jobs, 4GB RAM ARCHIVE RESERVE, … Upcoming jobs: ~ 1M 400% cheaper + extensible! 1 Proxy, 1 Beanstalkd, 1 MySQL = 200 req/s
    29. %w[ Transparent <Intercepting> Auth Cache … ] easy to make & a powerful hammer
    30. Cheers. Questions? The slides… Twitter My blog

    + Ilya GrigorikIlya Grigorik, 7 months ago

    custom

    3608 views, 22 favs, 10 embeds more stats

    A high-performance proxy server is less than a hund more

    More info about this document

    © All Rights Reserved

    Go to text version

    • Total Views 3608
      • 2253 on SlideShare
      • 1355 from embeds
    • Comments 0
    • Favorites 22
    • Downloads 0
    Most viewed embeds
    • 1333 views on http://www.igvita.com
    • 11 views on http://www.ultrasaurus.com
    • 2 views on http://www.hanrss.com
    • 2 views on http://www.zhuaxia.com
    • 2 views on http://sexydev.soup.io

    more

    All embeds
    • 1333 views on http://www.igvita.com
    • 11 views on http://www.ultrasaurus.com
    • 2 views on http://www.hanrss.com
    • 2 views on http://www.zhuaxia.com
    • 2 views on http://sexydev.soup.io
    • 1 views on http://feeds.feedburner.com
    • 1 views on http://127.0.0.1:8795
    • 1 views on http://xss.yandex.net
    • 1 views on http://www.protopage.com
    • 1 views on http://feeds.igvita.com

    less

    Flagged as inappropriate Flag as inappropriate
    Flag as inappropriate

    Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

    Cancel
    File a copyright complaint
    Having problems? Go to our helpdesk?

    Categories