public
Description: A very fast & simple Ruby web server
Homepage: http://code.macournoyer.com/thin/
Clone URL: git://github.com/macournoyer/thin.git
macournoyer (author)
Fri Jan 25 20:40:10 -0800 2008
commit  488564f0f113991d021c9166c85c5fe747a54eb2
tree    3d369fcb5f590e51da7b9af15171da4fa4185427
parent  38b7c0d42699fc8f40a48a08507021bab625adcb
thin / benchmark / simple.rb
100644 15 lines (12 sloc) 0.461 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# Simple benchmark to compare Thin performance against
# other webservers supported by Rack.
#
# Run with:
#
# ruby simple.rb [num of request]
#
require File.dirname(__FILE__) + '/../lib/thin'
require File.dirname(__FILE__) + '/utils'
 
request = (ARGV[0] || 1000).to_i # Number of request to send (ab -n option)
output_type = (ARGV[1] || 'print')
 
benchmark output_type, %w(WEBrick Mongrel EMongrel Thin), request, [1, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100]