SlideShare a Scribd company logo
Ruby Proxies for Scale, Performance and Monitoring Ilya Grigorik CTO / AideRSS Event-Driven Architectures  @igrigorik #meshu #eda  http://bit.ly/eda
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
Proxies for Monitoring, Performance and Scale welcome to   the wonderful world of intercepting, caching, … , proxy servers
Problem: Staging Environment Production Simulated User
“ Representative Load / Staging” Duplication Simulating traffic?
Staging fail. Profile of queries has changed Fail Load on production has changed Fail Parallel environment Fail Slower release cycle Fail
Replay  log data,  rinse, repeat github.com/igrigorik/autoperf
Benchmarking Proxy flash of the obvious Real (production) traffic Duplex Ruby Proxy, FTW!
Transparent Duplex Proxy, FTW
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
Ruby EventMachine crash course EM::Connection #receive_data   - new data ready for processing #unbind -  connection terminated #connection_completed   - connected
Duplex incoming data
Forward Production Response Analyze Results
Open connection to application server
Buffer until connected
Pass response to Duplex Notify when done
Analyze Time, Response…
Analyze Time, Response… Response Time
Cute, right? but so what…
%w[  <Transparent>  Intercepting  Caching … ]  solution for every problem
Validating Proxy easy, real-time diagnostics Woops!
Who said you’re not allowed to touch the data? Intercepting Proxy for those hard-to-reach spots
SMTP / Mail:  inject SPAM detection De(encrypt):  stream data MySQL:  inject sharding logic Intercepting Proxy for those hard-to-reach spots
@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!
@PostRank: “Chronos Scheduler” 1 “Medium” EC2 Instance Intercepting Proxy
Extend the protocol Chronos Scheduler Beanstalkd persistence Process incoming data Buffer “SCHEDULE” requests, otherwise forward
Archive to MySQL Chronos Scheduler Beanstalkd persistence Buffer “SCHEDULE”
@PostRank: “Chronos Scheduler” Extend the protocol ARCHIVE RESERVE, … 10 line patch to client: queue.archive(job)
@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
%w[ Transparent  <Intercepting>   Auth  Cache … ]  easy to make & a powerful hammer
Cheers. Questions? The slides… Twitter My blog

More Related Content

What's hot (20)

PPTX
The Atmosphere Framework
jfarcand
 
PDF
GWT Web Socket and data serialization
GWTcon
 
PDF
WebSockets with Spring 4
Sergi Almar i Graupera
 
PDF
Concurrent Ruby Application Servers
Lin Jen-Shin
 
PDF
Communication in Python and the C10k problem
Jose Galarza
 
PPT
Writing highly scalable WebSocket using the Atmosphere Framework and Scala
jfarcand
 
PPTX
Websockets on the JVM: Atmosphere to the rescue!
jfarcand
 
KEY
The HTML5 WebSocket API
David Lindkvist
 
PPTX
Asynchronous Web Programming with HTML5 WebSockets and Java
James Falkner
 
PPTX
Web sockets in Java
Pance Cavkovski
 
PPTX
Reverse ajax in 2014
Nenad Pecanac
 
PPTX
Writing Portable WebSockets in Java
jfarcand
 
PDF
Realtime web application with java
JeongHun Byeon
 
PDF
Introduction to WAMP, a protocol enabling PUB/SUB and RPC over Websocket
sametmax
 
KEY
Dancing with websocket
Damien Krotkine
 
PDF
Introduction to performance tuning perl web applications
Perrin Harkins
 
PDF
Building Real-Time Applications with Android and WebSockets
Sergi Almar i Graupera
 
PDF
Beyond Breakpoints: A Tour of Dynamic Analysis
Fastly
 
PDF
WebSockets wiith Scala and Play! Framework
Fabio Tiriticco
 
PDF
Going Live! with Comet
Simon Willison
 
The Atmosphere Framework
jfarcand
 
GWT Web Socket and data serialization
GWTcon
 
WebSockets with Spring 4
Sergi Almar i Graupera
 
Concurrent Ruby Application Servers
Lin Jen-Shin
 
Communication in Python and the C10k problem
Jose Galarza
 
Writing highly scalable WebSocket using the Atmosphere Framework and Scala
jfarcand
 
Websockets on the JVM: Atmosphere to the rescue!
jfarcand
 
The HTML5 WebSocket API
David Lindkvist
 
Asynchronous Web Programming with HTML5 WebSockets and Java
James Falkner
 
Web sockets in Java
Pance Cavkovski
 
Reverse ajax in 2014
Nenad Pecanac
 
Writing Portable WebSockets in Java
jfarcand
 
Realtime web application with java
JeongHun Byeon
 
Introduction to WAMP, a protocol enabling PUB/SUB and RPC over Websocket
sametmax
 
Dancing with websocket
Damien Krotkine
 
Introduction to performance tuning perl web applications
Perrin Harkins
 
Building Real-Time Applications with Android and WebSockets
Sergi Almar i Graupera
 
Beyond Breakpoints: A Tour of Dynamic Analysis
Fastly
 
WebSockets wiith Scala and Play! Framework
Fabio Tiriticco
 
Going Live! with Comet
Simon Willison
 

Similar to Ruby Proxies for Scale, Performance, and Monitoring - GoGaRuCo - igvita.com (20)

PDF
Evented applications with RabbitMQ and CakePHP
markstory
 
PDF
Celery: The Distributed Task Queue
Richard Leland
 
PDF
PHP projects beyond the LAMP stack
Codemotion
 
PDF
Porting Rails Apps to High Availability Systems
Marcelo Pinheiro
 
ODP
MNPHP Scalable Architecture 101 - Feb 3 2011
Mike Willbanks
 
PPTX
RabbitMQ Model and Some Example Applications
Houcheng Lin
 
PDF
Website Monitoring with Distributed Messages/Tasks Processing (AMQP & RabbitM...
Jimmy DeadcOde
 
ODP
Inter-Process/Task Communication With Message Queues
wamcvey
 
PDF
rspamd-slides
Vsevolod Stakhov
 
PDF
PyCon India 2012: Celery Talk
Piyush Kumar
 
PDF
Toster - Understanding the Rails Web Model and Scalability Options
Fabio Akita
 
PDF
Understanding the Rails web model and scalability options
.toster
 
PDF
Queue Everything and Please Everyone
Vaidik Kapoor
 
KEY
Messaging, interoperability and log aggregation - a new framework
Tomas Doran
 
PDF
The Current State of Asynchronous Processing With Ruby
mattmatt
 
ZIP
Message Queues in Ruby - An Overview
Pradeep Elankumaran
 
KEY
Rails services in the walled garden
Sidu Ponnappa
 
KEY
Event machine
almeidaricardo
 
PDF
RabbitMQ with python and ruby RuPy 2009
Paolo Negri
 
Evented applications with RabbitMQ and CakePHP
markstory
 
Celery: The Distributed Task Queue
Richard Leland
 
PHP projects beyond the LAMP stack
Codemotion
 
Porting Rails Apps to High Availability Systems
Marcelo Pinheiro
 
MNPHP Scalable Architecture 101 - Feb 3 2011
Mike Willbanks
 
RabbitMQ Model and Some Example Applications
Houcheng Lin
 
Website Monitoring with Distributed Messages/Tasks Processing (AMQP & RabbitM...
Jimmy DeadcOde
 
Inter-Process/Task Communication With Message Queues
wamcvey
 
rspamd-slides
Vsevolod Stakhov
 
PyCon India 2012: Celery Talk
Piyush Kumar
 
Toster - Understanding the Rails Web Model and Scalability Options
Fabio Akita
 
Understanding the Rails web model and scalability options
.toster
 
Queue Everything and Please Everyone
Vaidik Kapoor
 
Messaging, interoperability and log aggregation - a new framework
Tomas Doran
 
The Current State of Asynchronous Processing With Ruby
mattmatt
 
Message Queues in Ruby - An Overview
Pradeep Elankumaran
 
Rails services in the walled garden
Sidu Ponnappa
 
Event machine
almeidaricardo
 
RabbitMQ with python and ruby RuPy 2009
Paolo Negri
 
Ad

More from Ilya Grigorik (11)

PDF
Pagespeed what, why, and how it works
Ilya Grigorik
 
PDF
Making the web fast(er) - RailsConf 2012
Ilya Grigorik
 
PPTX
Ruby in the Browser - RubyConf 2011
Ilya Grigorik
 
PPTX
Intelligent Ruby + Machine Learning
Ilya Grigorik
 
PPTX
No Callbacks, No Threads - RailsConf 2010
Ilya Grigorik
 
PPTX
Real-time Ruby for the Real-time Web
Ilya Grigorik
 
PPTX
Ruby C10K: High Performance Networking - RubyKaigi '09
Ilya Grigorik
 
PPTX
Lean & Mean Tokyo Cabinet Recipes (with Lua) - FutureRuby '09
Ilya Grigorik
 
PPTX
Leveraging Social Media - Strategies & Tactics - PostRank
Ilya Grigorik
 
PPTX
Building Mini Google in Ruby
Ilya Grigorik
 
PPT
Taming The RSS Beast
Ilya Grigorik
 
Pagespeed what, why, and how it works
Ilya Grigorik
 
Making the web fast(er) - RailsConf 2012
Ilya Grigorik
 
Ruby in the Browser - RubyConf 2011
Ilya Grigorik
 
Intelligent Ruby + Machine Learning
Ilya Grigorik
 
No Callbacks, No Threads - RailsConf 2010
Ilya Grigorik
 
Real-time Ruby for the Real-time Web
Ilya Grigorik
 
Ruby C10K: High Performance Networking - RubyKaigi '09
Ilya Grigorik
 
Lean & Mean Tokyo Cabinet Recipes (with Lua) - FutureRuby '09
Ilya Grigorik
 
Leveraging Social Media - Strategies & Tactics - PostRank
Ilya Grigorik
 
Building Mini Google in Ruby
Ilya Grigorik
 
Taming The RSS Beast
Ilya Grigorik
 
Ad

Recently uploaded (20)

PDF
Python basic programing language for automation
DanialHabibi2
 
PPT
Interview paper part 3, It is based on Interview Prep
SoumyadeepGhosh39
 
PDF
Fl Studio 24.2.2 Build 4597 Crack for Windows Free Download 2025
faizk77g
 
PDF
Presentation - Vibe Coding The Future of Tech
yanuarsinggih1
 
PPTX
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
PDF
SFWelly Summer 25 Release Highlights July 2025
Anna Loughnan Colquhoun
 
PDF
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
PDF
Windsurf Meetup Ottawa 2025-07-12 - Planning Mode at Reliza.pdf
Pavel Shukhman
 
PDF
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
PPTX
✨Unleashing Collaboration: Salesforce Channels & Community Power in Patna!✨
SanjeetMishra29
 
PDF
CIFDAQ Token Spotlight for 9th July 2025
CIFDAQ
 
PDF
Log-Based Anomaly Detection: Enhancing System Reliability with Machine Learning
Mohammed BEKKOUCHE
 
PDF
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
PDF
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
PPTX
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
PDF
SWEBOK Guide and Software Services Engineering Education
Hironori Washizaki
 
PDF
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
PDF
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
PDF
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
PDF
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
Python basic programing language for automation
DanialHabibi2
 
Interview paper part 3, It is based on Interview Prep
SoumyadeepGhosh39
 
Fl Studio 24.2.2 Build 4597 Crack for Windows Free Download 2025
faizk77g
 
Presentation - Vibe Coding The Future of Tech
yanuarsinggih1
 
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
SFWelly Summer 25 Release Highlights July 2025
Anna Loughnan Colquhoun
 
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
Windsurf Meetup Ottawa 2025-07-12 - Planning Mode at Reliza.pdf
Pavel Shukhman
 
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
✨Unleashing Collaboration: Salesforce Channels & Community Power in Patna!✨
SanjeetMishra29
 
CIFDAQ Token Spotlight for 9th July 2025
CIFDAQ
 
Log-Based Anomaly Detection: Enhancing System Reliability with Machine Learning
Mohammed BEKKOUCHE
 
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
SWEBOK Guide and Software Services Engineering Education
Hironori Washizaki
 
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 

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

Editor's Notes

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