Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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