gogarugo – the evolving ultrasaurus Sarah Allen's reflections on internet software and other topics Fri, 17 Apr 2009 22:11:00 +0000 en-US hourly 1 https://wordpress.org/?v=5.7.1 ruby proxies /2009/04/ruby-proxies/ /2009/04/ruby-proxies/#respond Fri, 17 Apr 2009 22:11:00 +0000 /?p=1051 Continue reading ]]> Ilya Grigorik, gave a very informative talk “Ruby Proxies for Scale, Performance, and Monitoring”

Ilya describes a proxy server as his new favorite hammer. I can think of lots of cases where having an easy way to write a proxy server would come in handy. Mostly what we think of when we think of proxy servers is a “transparent, cut-through proxy,” but proxies can be useful for other purposes.

The problem that led Ilya to write a proxy server was benchmarking and performance testing. He started with HTTPPerf is good tool for simulating load, but it is only good for a single run. autoperf will make multiple runs and simulate more users.

em-proxy Very simple syntax to send traffic to both the production server and benchmark server (and only the response is returned from production). Real-time benchmarking against production traffic and user sees no performance hit. Only about 300 lines of code, shows the pattern for how to build a proxy server.

Ilya walked us through using EventMachine which has very concise, easy-to-read syntax for implementing proxy servers. This does not need to be restricted to http, but can work with any protocol.

Ilya described an interesting use case in detail. They created a proxy server which works with Beanstalkd, a distributed in-member work queue, where jobs are stored in MySql when they don’t need to be in memory.

Slides from the talk:

]]>
/2009/04/ruby-proxies/feed/ 0