Skip to content

Instantly share code, notes, and snippets.

@kyledrake
Created August 5, 2011 20:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kyledrake/1128433 to your computer and use it in GitHub Desktop.
Save kyledrake/1128433 to your computer and use it in GitHub Desktop.
Rubinius day web server parallelism benchmarking tests
### TEST 1: Simple Rack app RAW AND DUMB
class HelloRubinius
def call(env)
return [
200,
{'Content-Type' => 'text/html'},
['Hello #rbxday!']
]
end
end
run HelloRubinius.new
# Test with: Webrick, Mongrel, Thin, Unicorn, Rainbows (ThreadPool), Rainbows(ThreadSpawn), Rainbows(EventMachine)
### TEST 2: Sinatra RAW AND DUMB
get '/' do
'Hello #rbxday!'
end
# Test with: Webrick, Mongrel, Thin, Unicorn, Rainbows (ThreadPool), Rainbows(ThreadSpawn), Rainbows(EventMachine)
### TEST 3: SLEEPER
# FOR THREADS:
get '/' do
sleep 1
'ok'
end
# Test with: Webrick, Mongrel, Unicorn, Rainbows(ThreadPool), Rainbows(ThreadSpawn)
# FOR EM:
get '/' do
EM.sleep 1
'ok'
end
# Test with: Thin, Rainbows(EM)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment