Skip to content

Commit

Permalink
doc
Browse files Browse the repository at this point in the history
  • Loading branch information
igrigorik committed Apr 17, 2009
1 parent bd01e57 commit 9310a9d
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 2 deletions.
22 changes: 22 additions & 0 deletions README.rdoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
= EM-Proxy

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


== Why?

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.

== Example

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

> curl localhost:9000
File renamed without changes.
3 changes: 1 addition & 2 deletions server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@

options.merge!(YAML.load(File.read(options[:config])))

puts options.inspect

EventMachine.run do
EventMachine::ProxyServer.new(options).start
end

0 comments on commit 9310a9d

Please sign in to comment.