Skip to content
This repository


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

EventMachine proxies for performance, monitoring and scale

branch: master

This branch is 0 commits ahead and 0 commits behind master

Fetching latest commit…


Cannot retrieve the latest commit at this time

Octocat-spinner-32 demo
Octocat-spinner-32 lib
Octocat-spinner-32 README.rdoc
Octocat-spinner-32 server.rb


EventMachine HTTP Duplex Proxy: splits any incoming request into two parallel connections to two hosts.

  • One of the connections is marked as production: response is forwarded to client

  • One of the connections is marked as benchmark: response is buffered by the proxy

  • Once both connections are finished, a 'post processor' is executed

  • Response time + response body is compared and analyzed


Because sometimes you want to benchmark your new code against the production environment, and this pattern makes it easy to do so! Put up a proxy, customize it, and analyze whatever you want. The client won't notice a thing.


> ruby server.rb -c demo/duplex_http.yml
> ruby demo/appserver.rb 9001
> ruby demo/appserver.rb 9002

> curl localhost:9000
Something went wrong with that request. Please try again.