public
Description: A very fast & simple Ruby web server
Homepage: http://code.macournoyer.com/thin/
Clone URL: git://github.com/macournoyer/thin.git
Search Repo:
Fix benchmark script
macournoyer (author)
Mon Jan 28 18:00:30 -0800 2008
commit  fe618685efcb35f251865703a8028376008a5b10
tree    462a91402c81bf7384087ca07b4513d9f9effa67
parent  e94bf798052d2a1171789e0a95fa049ccc4d9ddd
...
3
4
5
6
 
7
8
9
10
11
 
12
 
13
14
 
...
3
4
5
 
6
7
8
9
10
 
11
12
13
14
 
15
0
@@ -3,13 +3,14 @@
0
 #
0
 # Run with:
0
 #
0
-# ruby simple.rb [num of request]]
0
+# ruby simple.rb [num of request] [print|graph] [concurrency levels]
0
 #
0
 require File.dirname(__FILE__) + '/../lib/thin'
0
 require File.dirname(__FILE__) + '/utils'
0
 
0
-request = (ARGV[0] || 1000).to_i # Number of request to send (ab -n option)
0
+request = (ARGV[0] || 1000).to_i # Number of request to send (ab -n option)
0
 output_type = (ARGV[1] || 'print')
0
+levels = eval(ARGV[2] || '[1, 10, 100]').to_a
0
 
0
-benchmark output_type, %w(WEBrick Mongrel EMongrel Thin), request, [1, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100]
0
+benchmark output_type, %w(WEBrick Mongrel EMongrel Thin), request, levels
...
29
30
31
32
 
33
34
35
...
29
30
31
 
32
33
34
35
0
@@ -29,7 +29,7 @@
0
 
0
   sleep 2
0
 
0
- out = `nice -n20 ab -c #{c} -n #{n} http://127.0.0.1:port/ 2> /dev/null`
0
+ out = `nice -n20 ab -c #{c} -n #{n} http://127.0.0.1:#{port}/ 2> /dev/null`
0
 
0
   Process.kill('SIGKILL', server)
0
   Process.wait

Comments

    No one has commented yet.