Created
December 19, 2008 19:16
-
-
Save lifo/38080 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Allow the metal piece to run in isolation | |
require(File.dirname(__FILE__) + "/../../config/environment") unless defined?(Rails) | |
class Scaling | |
def self.call(env) | |
if env["PATH_INFO"] =~ /^\/scaling/ | |
[200, {"Content-Type" => "text/html"}, ["Hello, World!"]] | |
else | |
[404, {"Content-Type" => "text/html"}, ["Not Found"]] | |
end | |
end | |
end | |
__END__ | |
# RAILS_ENV=production script/server thin | |
[lifo@null ~]$ ab -c 20 -n 1000 http://0.0.0.0:3000/scaling | |
3000 r/s |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# No database configured | |
# config.frameworks -= [ :active_record, :active_resource, :action_mailer ] | |
# | |
class WelcomeController < ApplicationController | |
def index | |
render :text => 'Hello Rails' | |
end | |
end | |
__END__ | |
# RAILS_ENV=production script/server thin | |
[lifo@null ~]$ ab -c 20 -n 1000 http://0.0.0.0:3000/ | |
800 r/s |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment