Run this program first of all necessary
gem install rack sinatra thin and thin install sinatra
gem install rails - source http://gems.rubyonrails.org install rails2.3.1 (2.3RC2)

app / metal / hello.rb is a rack structure sinatra middleware
app / controllers / hello_controller.rb are traditional rails controller

Run:
thin start or. / script / server start the rails
rackup-s thin-p 3000 app / metal / hello.rb start a separate application sinatra

Visit / hello / sinatra are rails traditional controller,
Visit / sinatra is sinatra applications, through the metal or a separate operation,
Between the return value is the same.

At my machine on (Ubuntu 8.04, Intel Atom N270@1.60GHz)

Run ab-n 100 http://localhost:3000/hello/sinatra the results are

Requests per second: 16.69 [# / sec] (mean)
Time per request: 59.923 [ms] (mean)

wujiang @ wujiang-laptop: ~ $ ab-n 100 http://localhost:3000/sinatra
Requests per second: 71.78 [# / sec] (mean)
Time per request: 13.932 [ms] (mean)

Direct run sinatra, ab-n 100 http://localhost:3000/sinatra
Requests per second: 208.39 [# / sec] (mean)
Time per request: 4.799 [ms] (mean)

Sinatra can see the efficiency of running a separate metal are three times

Then test the production environment, thin-e production start start rails production environment

wujiang @ wujiang-laptop: ~ $ ab-n 100 http://localhost:3000/hello/sinatra
Requests per second: 81.09 [# / sec] (mean)
Time per request: 12.332 [ms] (mean)

wujiang @ wujiang-laptop: ~ $ ab-n 100 http://localhost:3000/sinatra
Requests per second: 163.75 [# / sec] (mean)
Time per request: 6.107 [ms] (mean)

Finally thin-R app / metal / hello.rb-e production-p 3000 start start production environment sinatra
Requests per second: 450.56 [# / sec] (mean)
Time per request: 2.219 [ms] (mean)

Sinatra can see that metal is still 2.7 times the speed, sinatra still has the speed for the metal lead.