thin 0.5.3-x86-mswin32-60

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of thin might be problematic. Click here for more details.

Files changed (117) hide show
  1. data/CHANGELOG +40 -0
  2. data/COPYING +18 -0
  3. data/README +60 -0
  4. data/Rakefile +11 -0
  5. data/benchmark/simple.rb +48 -0
  6. data/bin/thin +123 -0
  7. data/doc/benchmarks.txt +86 -0
  8. data/doc/rdoc/classes/Process.html +181 -0
  9. data/doc/rdoc/classes/Rack.html +156 -0
  10. data/doc/rdoc/classes/Rack/Adapter.html +155 -0
  11. data/doc/rdoc/classes/Rack/Adapter/Rails.html +289 -0
  12. data/doc/rdoc/classes/Rack/Adapter/Rails/CGIWrapper.html +359 -0
  13. data/doc/rdoc/classes/Rack/Handler.html +155 -0
  14. data/doc/rdoc/classes/Rack/Handler/Thin.html +175 -0
  15. data/doc/rdoc/classes/Thin.html +164 -0
  16. data/doc/rdoc/classes/Thin/Cluster.html +399 -0
  17. data/doc/rdoc/classes/Thin/Connection.html +223 -0
  18. data/doc/rdoc/classes/Thin/Daemonizable.html +260 -0
  19. data/doc/rdoc/classes/Thin/Daemonizable/ClassMethods.html +197 -0
  20. data/doc/rdoc/classes/Thin/Headers.html +238 -0
  21. data/doc/rdoc/classes/Thin/InvalidRequest.html +144 -0
  22. data/doc/rdoc/classes/Thin/Logging.html +201 -0
  23. data/doc/rdoc/classes/Thin/Request.html +231 -0
  24. data/doc/rdoc/classes/Thin/Response.html +271 -0
  25. data/doc/rdoc/classes/Thin/Server.html +295 -0
  26. data/doc/rdoc/classes/Thin/StopServer.html +143 -0
  27. data/doc/rdoc/created.rid +1 -0
  28. data/doc/rdoc/files/README.html +226 -0
  29. data/doc/rdoc/files/bin/thin.html +245 -0
  30. data/doc/rdoc/files/lib/rack/adapter/rails_rb.html +146 -0
  31. data/doc/rdoc/files/lib/rack/handler/thin_rb.html +146 -0
  32. data/doc/rdoc/files/lib/thin/cluster_rb.html +146 -0
  33. data/doc/rdoc/files/lib/thin/connection_rb.html +145 -0
  34. data/doc/rdoc/files/lib/thin/daemonizing_rb.html +146 -0
  35. data/doc/rdoc/files/lib/thin/headers_rb.html +146 -0
  36. data/doc/rdoc/files/lib/thin/logging_rb.html +146 -0
  37. data/doc/rdoc/files/lib/thin/request_rb.html +145 -0
  38. data/doc/rdoc/files/lib/thin/response_rb.html +145 -0
  39. data/doc/rdoc/files/lib/thin/server_rb.html +145 -0
  40. data/doc/rdoc/files/lib/thin/statuses_rb.html +145 -0
  41. data/doc/rdoc/files/lib/thin/version_rb.html +145 -0
  42. data/doc/rdoc/files/lib/thin_rb.html +152 -0
  43. data/doc/rdoc/index.html +10 -0
  44. data/doc/rdoc/logo.gif +0 -0
  45. data/doc/rdoc/rdoc-style.css +55 -0
  46. data/example/config.ru +9 -0
  47. data/example/thin.god +72 -0
  48. data/ext/thin_parser/common.rl +54 -0
  49. data/ext/thin_parser/ext_help.h +14 -0
  50. data/ext/thin_parser/extconf.rb +6 -0
  51. data/ext/thin_parser/parser.c +1199 -0
  52. data/ext/thin_parser/parser.h +49 -0
  53. data/ext/thin_parser/parser.rl +143 -0
  54. data/ext/thin_parser/thin.c +424 -0
  55. data/lib/rack/adapter/rails.rb +155 -0
  56. data/lib/rack/handler/thin.rb +13 -0
  57. data/lib/thin.rb +36 -0
  58. data/lib/thin/cluster.rb +106 -0
  59. data/lib/thin/connection.rb +46 -0
  60. data/lib/thin/daemonizing.rb +112 -0
  61. data/lib/thin/headers.rb +37 -0
  62. data/lib/thin/logging.rb +23 -0
  63. data/lib/thin/request.rb +72 -0
  64. data/lib/thin/response.rb +48 -0
  65. data/lib/thin/server.rb +80 -0
  66. data/lib/thin/statuses.rb +43 -0
  67. data/lib/thin/version.rb +11 -0
  68. data/lib/thin_parser.so +0 -0
  69. data/spec/cluster_spec.rb +58 -0
  70. data/spec/daemonizing_spec.rb +93 -0
  71. data/spec/headers_spec.rb +35 -0
  72. data/spec/rack_rails_spec.rb +92 -0
  73. data/spec/rails_app/app/controllers/application.rb +10 -0
  74. data/spec/rails_app/app/controllers/simple_controller.rb +19 -0
  75. data/spec/rails_app/app/helpers/application_helper.rb +3 -0
  76. data/spec/rails_app/app/views/simple/index.html.erb +15 -0
  77. data/spec/rails_app/config/boot.rb +109 -0
  78. data/spec/rails_app/config/environment.rb +64 -0
  79. data/spec/rails_app/config/environments/development.rb +18 -0
  80. data/spec/rails_app/config/environments/production.rb +19 -0
  81. data/spec/rails_app/config/environments/test.rb +22 -0
  82. data/spec/rails_app/config/initializers/inflections.rb +10 -0
  83. data/spec/rails_app/config/initializers/mime_types.rb +5 -0
  84. data/spec/rails_app/config/routes.rb +35 -0
  85. data/spec/rails_app/public/404.html +30 -0
  86. data/spec/rails_app/public/422.html +30 -0
  87. data/spec/rails_app/public/500.html +30 -0
  88. data/spec/rails_app/public/dispatch.cgi +10 -0
  89. data/spec/rails_app/public/dispatch.fcgi +24 -0
  90. data/spec/rails_app/public/dispatch.rb +10 -0
  91. data/spec/rails_app/public/favicon.ico +0 -0
  92. data/spec/rails_app/public/images/rails.png +0 -0
  93. data/spec/rails_app/public/index.html +277 -0
  94. data/spec/rails_app/public/javascripts/application.js +2 -0
  95. data/spec/rails_app/public/javascripts/controls.js +963 -0
  96. data/spec/rails_app/public/javascripts/dragdrop.js +972 -0
  97. data/spec/rails_app/public/javascripts/effects.js +1120 -0
  98. data/spec/rails_app/public/javascripts/prototype.js +4225 -0
  99. data/spec/rails_app/public/robots.txt +5 -0
  100. data/spec/rails_app/script/about +3 -0
  101. data/spec/rails_app/script/console +3 -0
  102. data/spec/rails_app/script/destroy +3 -0
  103. data/spec/rails_app/script/generate +3 -0
  104. data/spec/rails_app/script/performance/benchmarker +3 -0
  105. data/spec/rails_app/script/performance/profiler +3 -0
  106. data/spec/rails_app/script/performance/request +3 -0
  107. data/spec/rails_app/script/plugin +3 -0
  108. data/spec/rails_app/script/process/inspector +3 -0
  109. data/spec/rails_app/script/process/reaper +3 -0
  110. data/spec/rails_app/script/process/spawner +3 -0
  111. data/spec/rails_app/script/runner +3 -0
  112. data/spec/rails_app/script/server +3 -0
  113. data/spec/request_spec.rb +258 -0
  114. data/spec/response_spec.rb +56 -0
  115. data/spec/server_spec.rb +75 -0
  116. data/spec/spec_helper.rb +127 -0
  117. metadata +219 -0
data/CHANGELOG ADDED
@@ -0,0 +1,40 @@
1
+ == 0.5.3 Purple Yogurt release
2
+ * win32 pre-compiled gem now available
3
+ * change rake task configuration to allow win32 gem build
4
+ * Add prefix option to thin script to mount app under a given path.
5
+
6
+ == 0.5.2 Cheezburger release
7
+ * Add cluster support through the -s option in the thin script, start 3 thins like this:
8
+ thin start -s3 -p3000
9
+ 3 thin servers will be started on port 3000, 3001, 3002, also the port number will be
10
+ injected in the pid and log filenames.
11
+ * Fix IOError when writing to logger when starting server as a daemon.
12
+ * Really change directory when the -c option is specified.
13
+ * Add restart command to thin script.
14
+ * Fix typos in thin script usage message and expand chdir path.
15
+ * Rename thin script options to be the same as mongrel_rails script [thronedrk]:
16
+ -o --host => -a --address
17
+ --log-file => --log
18
+ --pid-file => --pid
19
+ --env => --environment
20
+
21
+ == 0.5.1 LOLCAT release
22
+ * Add URL rewriting to Rails adapter so that page caching works and / fetches index.html if present.
23
+ * Fix bug in multiline response header parsing.
24
+ * Add specs for the Rails adapter.
25
+ * Fix Set-Cookie headers in Rails adapter to handle multiple values correctly.
26
+ * Fix Ruby 1.9 incompatibility in Response#headers= and Rakefile.
27
+ * Fix parser to be Ruby 1.9 compatible [Aman Gupta]
28
+ * Set gemspec to use EventMachine version 0.8.1 as it's the latest one having precompiled windows binaries.
29
+ [Francis Cianfrocca].
30
+ * Add -D option to thin script to set debugging on.
31
+ * Output incoming data and response when debugging is on.
32
+
33
+ == 0.5.0
34
+ * Full rewrite to use EventMachine, Rack and Mongrel parser
35
+
36
+ == 0.4.1
37
+ * Fix Rails environment option not being used in thin script.
38
+
39
+ == 0.4.0
40
+ * First alphaish release as a gem.
data/COPYING ADDED
@@ -0,0 +1,18 @@
1
+ Copyright (c) 2008 Marc-Andre Cournoyer
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy
4
+ of this software and associated documentation files (the "Software"), to
5
+ deal in the Software without restriction, including without limitation the
6
+ rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
7
+ sell copies of the Software, and to permit persons to whom the Software is
8
+ furnished to do so, subject to the following conditions:
9
+
10
+ The above copyright notice and this permission notice shall be included in
11
+ all copies or substantial portions of the Software.
12
+
13
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
16
+ THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
17
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
18
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README ADDED
@@ -0,0 +1,60 @@
1
+ == Thin
2
+ Tiny, fast & funny HTTP server
3
+
4
+ Thin is a Ruby web server that glues together 3 of the best Ruby libraries in web history:
5
+ * the Mongrel parser: the root of Mongrel speed and security
6
+ * Event Machine: a network I/O library with extremely high scalability, performance and stability
7
+ * Rack: a minimal interface between webservers and Ruby frameworks
8
+ Which makes it, with all humility, the most secure, stable, fast and extensible Ruby web server
9
+ bundled in an easy to use gem for your own pleasure.
10
+
11
+ === Installation
12
+ For the latest stable version:
13
+
14
+ sudo gem install thin
15
+
16
+ or using my mirror (might be more recent):
17
+
18
+ sudo gem install thin --source http://code.macournoyer.com
19
+
20
+ Or from source:
21
+
22
+ git clone git://repo.or.cz/thin.git
23
+ cd thin
24
+ rake install
25
+
26
+ === Usage
27
+ A +thin+ script is offered to easily start your Rails application:
28
+
29
+ cd to/your/rails/app
30
+ thin start
31
+
32
+ But Thin is also usable through Rack +rackup+ command.
33
+ You need to setup a config.ru file and require thin in it:
34
+
35
+ cat <<EOS
36
+ require 'thin'
37
+
38
+ app = proc do |env|
39
+ [200, {'Content-Type'=>'text/html'}, ['hi']]
40
+ end
41
+
42
+ run app
43
+ EOS
44
+ rackup -s thin
45
+
46
+ See example/config.ru for details and rackup -h
47
+
48
+ === License
49
+ Ruby License, http://www.ruby-lang.org/en/LICENSE.txt.
50
+
51
+ === Credits
52
+ The parser was stolen from Mongrel http://mongrel.rubyforge.org by Zed Shaw.
53
+ Mongrel Web Server (Mongrel) is copyrighted free software by Zed A. Shaw
54
+ <zedshaw at zedshaw dot com> You can redistribute it and/or modify it under
55
+ either the terms of the GPL.
56
+
57
+ Thin is copyright Marc-Andre Cournoyer <macournoyer@gmail.com>
58
+
59
+ Please report any bug at http://groups.google.com/group/thin-ruby/
60
+ and major security issues directly to me at macournoyer@gmail.com.
data/Rakefile ADDED
@@ -0,0 +1,11 @@
1
+ RUBY_1_9 = RUBY_VERSION =~ /^1\.9/
2
+ WIN = (PLATFORM =~ /mswin|cygwin/)
3
+ SUDO = (WIN ? "" : "sudo")
4
+
5
+ require 'rake'
6
+ require 'rake/clean'
7
+ require 'lib/thin'
8
+
9
+ Dir['tasks/**/*.rake'].each { |rake| load rake }
10
+
11
+ task :default => [:compile, :spec]
@@ -0,0 +1,48 @@
1
+ # Simple benchmark to compare Thin performance against
2
+ # other webservers supported by Rack.
3
+ #
4
+ # Run with:
5
+ #
6
+ # ruby simple.rb [num of request]
7
+ #
8
+ require File.dirname(__FILE__) + '/../lib/thin'
9
+ require 'rack/lobster'
10
+
11
+ REQUEST = (ARGV[0] || 1000).to_i # Number of request to send (ab -n option)
12
+
13
+ def run(handler_name, c=1, n=REQUEST)
14
+ server = fork do
15
+ [STDOUT, STDERR].each { |o| o.reopen "/dev/null" }
16
+
17
+ app = Rack::Lobster.new
18
+
19
+ if handler_name == 'EMongrel'
20
+ require 'swiftcore/evented_mongrel'
21
+ handler_name = 'Mongrel'
22
+ end
23
+ handler = Rack::Handler.const_get(handler_name)
24
+ handler.run app, :Host => '0.0.0.0', :Port => 7000
25
+ end
26
+
27
+ sleep 2
28
+
29
+ out = `nice -n20 ab -c #{c} -n #{n} http://127.0.0.1:7000/ 2> /dev/null`
30
+
31
+ Process.kill('SIGKILL', server)
32
+ Process.wait
33
+
34
+ if requests = out.match(/^Requests.+?(\d+\.\d+)/)
35
+ failed = out.match(/^Failed requests.+?(\d+)$/)[1]
36
+ "#{requests[1].to_s.ljust(9)} #{failed}"
37
+ else
38
+ 'ERROR'
39
+ end
40
+ end
41
+
42
+ puts 'server request concurrency req/s failures'
43
+ puts '=' * 53
44
+ [1, 10, 100].each do |c|
45
+ %w(WEBrick Mongrel EMongrel Thin).each do |server|
46
+ puts "#{server.ljust(8)} #{REQUEST} #{c.to_s.ljust(4)} #{run(server, c)}"
47
+ end
48
+ end
data/bin/thin ADDED
@@ -0,0 +1,123 @@
1
+ #!/usr/bin/env ruby
2
+ # <tt>thin start</tt>: Starts the Rails app in the current directory.
3
+ # Run <tt>thin -h</tt> to get more usage.
4
+ require File.dirname(__FILE__) + '/../lib/thin'
5
+ require 'optparse'
6
+
7
+ COMMANDS = %w(start stop restart)
8
+
9
+ # Default options values
10
+ options = {
11
+ :chdir => Dir.pwd,
12
+ :environment => 'development',
13
+ :address => '0.0.0.0',
14
+ :port => 3000,
15
+ :timeout => 60,
16
+ :log => 'log/thin.log',
17
+ :pid => 'tmp/pids/thin.pid',
18
+ :servers => 1 # no cluster
19
+ }
20
+
21
+ # NOTE: If you add an option here make sure the key in the +options+ hash is the
22
+ # same as the name of the command line option.
23
+ # +option+ keys are use to build the command line to launch a cluster,
24
+ # see <tt>lib/thin/cluster.rb</tt>.
25
+ opts = OptionParser.new do |opts|
26
+ opts.banner = "Usage: thin [options] #{COMMANDS.join('|')}"
27
+
28
+ opts.separator ""
29
+ opts.separator "Server options:"
30
+
31
+ opts.on("-a", "--address HOST", "bind to HOST address (default: 0.0.0.0)") { |host| options[:address] = host }
32
+ opts.on("-p", "--port PORT", "use PORT (default: 3000)") { |port| options[:port] = port.to_i }
33
+ opts.on("-e", "--environment ENV", "Rails environment (default: development)") { |env| options[:environment] = env }
34
+ opts.on("-c", "--chdir PATH", "Change to dir before starting") { |dir| options[:chdir] = File.expand_path(dir) }
35
+ opts.on("-s", "--servers NUM", "Number of servers to start",
36
+ "set a value >1 to start a cluster") { |num| options[:servers] = num.to_i }
37
+ opts.on("-d", "--daemonize", "Run daemonized in the background") { options[:daemonize] = true }
38
+ opts.on("-l", "--log FILE", "File to redirect output",
39
+ "(default: #{options[:log]})") { |file| options[:log] = file }
40
+ opts.on("-P", "--pid FILE", "File to store PID",
41
+ "(default: #{options[:pid]})") { |file| options[:pid] = file }
42
+ opts.on("-t", "--timeout SEC", "Request or command timeout in sec",
43
+ "(default: #{options[:timeout]})") { |sec| options[:timeout] = sec.to_i }
44
+ opts.on("-u", "--user NAME", "User to run daemon as (use with -g)") { |user| options[:user] = user }
45
+ opts.on("-g", "--group NAME", "Group to run daemon as (use with -u)") { |group| options[:group] = group }
46
+ opts.on( "--prefix PATH", "Mount the app under PATH (start with /)") { |path| options[:prefix] = path }
47
+
48
+ opts.separator ""
49
+ opts.separator "Common options:"
50
+
51
+ opts.on_tail("-D", "--debug", "Set debbuging on") { $DEBUG = true }
52
+ opts.on_tail("-h", "--help", "Show this message") { puts opts; exit }
53
+ opts.on_tail('-v', '--version', "Show version") { puts Thin::SERVER; exit }
54
+
55
+ opts.parse! ARGV
56
+ end
57
+
58
+
59
+ # == Commands definitions
60
+
61
+ def cluster?(options)
62
+ options[:servers] && options[:servers] > 1
63
+ end
64
+
65
+ def start(options)
66
+ if cluster?(options)
67
+ Thin::Cluster.new(options).start
68
+ else
69
+ server = Thin::Server.new(options[:address], options[:port])
70
+
71
+ server.pid_file = options[:pid]
72
+ server.log_file = options[:log]
73
+ server.timeout = options[:timeout]
74
+
75
+ if options[:daemonize]
76
+ server.change_privilege options[:user], options[:group] if options[:user] && options[:group]
77
+ server.daemonize
78
+ end
79
+
80
+ server.app = Rack::Adapter::Rails.new(options.merge(:root => options[:chdir]))
81
+
82
+ # If a prefix is required, wrap in Rack URL mapper
83
+ server.app = Rack::URLMap.new(options[:prefix] => server.app) if options[:prefix]
84
+
85
+ server.start!
86
+ end
87
+ end
88
+
89
+ def stop(options)
90
+ if cluster?(options)
91
+ Thin::Cluster.new(options).stop
92
+ else
93
+ Thin::Server.kill options[:pid], options[:timeout]
94
+ end
95
+ end
96
+
97
+ def restart(options)
98
+ if cluster?(options)
99
+ Thin::Cluster.new(options).restart
100
+ else
101
+ # Restart only make sense when running as a daemon
102
+ options.update :daemonize => true
103
+
104
+ stop(options)
105
+ start(options)
106
+ end
107
+ end
108
+
109
+
110
+ # == Runs the command
111
+
112
+ Dir.chdir(options[:chdir])
113
+ command = ARGV[0]
114
+
115
+ if COMMANDS.include?(command)
116
+ send(command, options)
117
+ elsif command.nil?
118
+ puts "Command required"
119
+ puts opts
120
+ exit 1
121
+ else
122
+ abort "Invalid command : #{command}"
123
+ end
@@ -0,0 +1,86 @@
1
+ == Process
2
+ * rackup ...
3
+ * nice -n20 httperf --port 9292 --num-conns 9000
4
+ * nice -n20 ab -n5000 localhost:9292/
5
+ * nice -n20 ab -n5000 -c10 localhost:9292/
6
+ * nice -n20 ab -n5000 -c100 localhost:9292/
7
+
8
+ == More Benchmarks
9
+ http://www.webficient.com/2007/08/testing-various-configurations-of-rails.html
10
+
11
+ === WEBrick
12
+ rackup -s webrick
13
+
14
+ ==== httperf
15
+ Reply rate [replies/s]: min 303.8 avg 306.8 max 310.4 stddev 2.8 (5 samples)
16
+ Reply rate [replies/s]: min 235.8 avg 292.2 max 306.4 stddev 27.7 (6 samples)
17
+ Reply rate [replies/s]: min 304.8 avg 306.9 max 308.8 stddev 1.5 (5 samples)
18
+ avg: 302.0 10.7
19
+
20
+ ==== Concurrency Level 1
21
+ 297.37 [#/sec] (mean)
22
+
23
+ ==== Concurrency Level 10
24
+ 296.65 [#/sec] (mean) Failed requests: 4 (Connect: 2, Length: 2, Exceptions: 0)
25
+ 298.22 [#/sec] (mean) Failed requests: 4 (Connect: 2, Length: 2, Exceptions: 0)
26
+
27
+ ==== Concurrency Level 100
28
+ 297.16 [#/sec] (mean) Failed requests: 489 (Connect: 245, Length: 244, Exceptions: 0)
29
+
30
+
31
+ === Mongrel
32
+ rackup -s mongrel
33
+
34
+ ==== httperf
35
+ Reply rate [replies/s]: min 556.4 avg 580.1 max 613.6 stddev 29.9 (3 samples)
36
+ Reply rate [replies/s]: min 299.0 avg 502.6 max 613.4 stddev 176.5 (3 samples)
37
+ Reply rate [replies/s]: min 601.0 avg 608.5 max 616.0 stddev 10.7 (2 samples)
38
+ Reply rate [replies/s]: min 605.2 avg 608.4 max 611.6 stddev 4.5 (2 samples)
39
+ avg: 574.9 55.4
40
+
41
+ ==== Concurrency Level 1
42
+ 556.67 [#/sec] (mean)
43
+
44
+ ==== Concurrency Level 10
45
+ 622.90 [#/sec] (mean)
46
+
47
+ ==== Concurrency Level 100
48
+ 428.23 [#/sec] (mean)
49
+
50
+ === Evented Mongrel
51
+ rackup -r "swiftcore/evented_mongrel" -s mongrel
52
+
53
+ ==== httperf
54
+ Reply rate [replies/s]: min 452.4 avg 541.0 max 590.0 stddev 76.9 (3 samples)
55
+ Reply rate [replies/s]: min 573.2 avg 586.0 max 593.0 stddev 11.1 (3 samples)
56
+ Reply rate [replies/s]: min 546.6 avg 574.8 max 594.6 stddev 25.0 (3 samples)
57
+ Reply rate [replies/s]: min 593.6 avg 595.2 max 596.4 stddev 1.5 (3 samples)
58
+ avg: 574.25 28.625
59
+
60
+ ==== Concurrency Level 1
61
+ 517.97 [#/sec] (mean)
62
+
63
+ ==== Concurrency Level 10
64
+ 657.89 [#/sec] (mean)
65
+
66
+ ==== Concurrency Level 100
67
+ 656.17 [#/sec] (mean)
68
+
69
+ === Thin
70
+ rackup -s thin
71
+
72
+ ==== httperf
73
+ Reply rate [replies/s]: min 671.4 avg 681.0 max 690.7 stddev 13.6 (2 samples)
74
+ Reply rate [replies/s]: min 690.0 avg 695.8 max 701.7 stddev 8.3 (2 samples)
75
+ Reply rate [replies/s]: min 643.4 avg 669.4 max 695.4 stddev 36.7 (2 samples)
76
+ Reply rate [replies/s]: min 694.1 avg 695.8 max 697.6 stddev 2.5 (2 samples)
77
+ avg: 685.5 15.275
78
+
79
+ ==== Concurrency Level 1
80
+ 719.53 [#/sec] (mean)
81
+
82
+ ==== Concurrency Level 10
83
+ 782.11 [#/sec] (mean)
84
+
85
+ ==== Concurrency Level 100
86
+ 776.40 [#/sec] (mean)
@@ -0,0 +1,181 @@
1
+
2
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
3
+ <html>
4
+ <head>
5
+ <title>
6
+ thin &raquo; Module: Process
7
+ </title>
8
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
9
+ <link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
10
+ <script language="JavaScript" type="text/javascript">
11
+ // <![CDATA[
12
+
13
+ function toggleSource( id )
14
+ {
15
+ var elem
16
+ var link
17
+
18
+ if( document.getElementById )
19
+ {
20
+ elem = document.getElementById( id )
21
+ link = document.getElementById( "l_" + id )
22
+ }
23
+ else if ( document.all )
24
+ {
25
+ elem = eval( "document.all." + id )
26
+ link = eval( "document.all.l_" + id )
27
+ }
28
+ else
29
+ return false;
30
+
31
+ if( elem.style.display == "block" )
32
+ {
33
+ elem.style.display = "none"
34
+ link.innerHTML = "show source"
35
+ }
36
+ else
37
+ {
38
+ elem.style.display = "block"
39
+ link.innerHTML = "hide source"
40
+ }
41
+ }
42
+
43
+ function openCode( url )
44
+ {
45
+ window.open( url, "SOURCE_CODE", "width=400,height=400,scrollbars=yes" )
46
+ }
47
+ // ]]>
48
+ </script>
49
+ </head>
50
+ <body>
51
+ <ul id="menu">
52
+ <li><a href="/thin/">about</a></li>
53
+ <li><a href="/thin/download/">download</a></li>
54
+ <li><a href="/thin/usage/">usage</a></li>
55
+ <li><a href="/thin/doc/">doc</a></li>
56
+ <li><a href="http://groups.google.com/group/thin-ruby/">community</a></li>
57
+ </ul>
58
+ <div id="sidebar">
59
+ <h2>Files</h2>
60
+ <ul class="list">
61
+ <li><a href="../files/README.html" value="File: README">README</a></li>
62
+ <li><a href="../files/lib/rack/adapter/rails_rb.html" value="File: rails.rb">lib/rack/adapter/rails.rb</a></li>
63
+ <li><a href="../files/lib/rack/handler/thin_rb.html" value="File: thin.rb">lib/rack/handler/thin.rb</a></li>
64
+ <li><a href="../files/lib/thin/cluster_rb.html" value="File: cluster.rb">lib/thin/cluster.rb</a></li>
65
+ <li><a href="../files/lib/thin/connection_rb.html" value="File: connection.rb">lib/thin/connection.rb</a></li>
66
+ <li><a href="../files/lib/thin/daemonizing_rb.html" value="File: daemonizing.rb">lib/thin/daemonizing.rb</a></li>
67
+ <li><a href="../files/lib/thin/headers_rb.html" value="File: headers.rb">lib/thin/headers.rb</a></li>
68
+ <li><a href="../files/lib/thin/logging_rb.html" value="File: logging.rb">lib/thin/logging.rb</a></li>
69
+ <li><a href="../files/lib/thin/request_rb.html" value="File: request.rb">lib/thin/request.rb</a></li>
70
+ <li><a href="../files/lib/thin/response_rb.html" value="File: response.rb">lib/thin/response.rb</a></li>
71
+ <li><a href="../files/lib/thin/server_rb.html" value="File: server.rb">lib/thin/server.rb</a></li>
72
+ <li><a href="../files/lib/thin/statuses_rb.html" value="File: statuses.rb">lib/thin/statuses.rb</a></li>
73
+ <li><a href="../files/lib/thin/version_rb.html" value="File: version.rb">lib/thin/version.rb</a></li>
74
+ <li><a href="../files/lib/thin_rb.html" value="File: thin.rb">lib/thin.rb</a></li>
75
+ <li><a href="../files/bin/thin.html" value="File: thin">bin/thin</a></li>
76
+ </ul>
77
+
78
+ <h2>Classes</h2>
79
+ <ul class="list">
80
+ <li><a href="../classes/Rack.html" title="Module: Rack">Rack</a></li>
81
+ <li><a href="../classes/Rack/Adapter.html" title="Module: Rack::Adapter">Rack::Adapter</a></li>
82
+ <li><a href="../classes/Rack/Adapter/Rails.html" title="Class: Rack::Adapter::Rails">Rack::Adapter::Rails</a></li>
83
+ <li><a href="../classes/Rack/Adapter/Rails/CGIWrapper.html" title="Class: Rack::Adapter::Rails::CGIWrapper">Rack::Adapter::Rails::CGIWrapper</a></li>
84
+ <li><a href="../classes/Rack/Handler.html" title="Module: Rack::Handler">Rack::Handler</a></li>
85
+ <li><a href="../classes/Rack/Handler/Thin.html" title="Class: Rack::Handler::Thin">Rack::Handler::Thin</a></li>
86
+ <li><a href="../classes/Thin.html" title="Module: Thin">Thin</a></li>
87
+ <li><a href="../classes/Thin/Daemonizable.html" title="Module: Thin::Daemonizable">Thin::Daemonizable</a></li>
88
+ <li><a href="../classes/Thin/Daemonizable/ClassMethods.html" title="Module: Thin::Daemonizable::ClassMethods">Thin::Daemonizable::ClassMethods</a></li>
89
+ <li><a href="../classes/Thin/VERSION.html" title="Module: Thin::VERSION">Thin::VERSION</a></li>
90
+ <li><a href="../classes/Thin/Logging.html" title="Module: Thin::Logging">Thin::Logging</a></li>
91
+ <li><a href="../classes/Thin/InvalidRequest.html" title="Class: Thin::InvalidRequest">Thin::InvalidRequest</a></li>
92
+ <li><a href="../classes/Thin/StopServer.html" title="Class: Thin::StopServer">Thin::StopServer</a></li>
93
+ <li><a href="../classes/Thin/Response.html" title="Class: Thin::Response">Thin::Response</a></li>
94
+ <li><a href="../classes/Thin/Headers.html" title="Class: Thin::Headers">Thin::Headers</a></li>
95
+ <li><a href="../classes/Thin/Server.html" title="Class: Thin::Server">Thin::Server</a></li>
96
+ <li><a href="../classes/Thin/Request.html" title="Class: Thin::Request">Thin::Request</a></li>
97
+ <li><a href="../classes/Thin/Connection.html" title="Class: Thin::Connection">Thin::Connection</a></li>
98
+ <li><a href="../classes/Thin/Cluster.html" title="Class: Thin::Cluster">Thin::Cluster</a></li>
99
+ <li><a href="../classes/Process.html" title="Module: Process">Process</a></li>
100
+ </ul>
101
+ </div>
102
+ <div id="container">
103
+ <div id="header">
104
+ <a href="/thin/" title="Home">
105
+ <img id="logo" src="../logo.gif" />
106
+ </a>
107
+ <h2 id="tag_line">A fast and very simple Ruby web server</h2>
108
+ </div>
109
+
110
+ <div id="content">
111
+ <h2>Module: Process</h2>
112
+
113
+
114
+ <div id="Process" class="page_shade">
115
+ <div class="page">
116
+ <h3>Module Process &lt; Object</h3>
117
+
118
+ <span class="path">(in files
119
+ <a href="../files/lib/thin/daemonizing_rb.html">lib/thin/daemonizing.rb</a>
120
+ )</span>
121
+
122
+ <p>
123
+ Control a set of servers.
124
+ </p>
125
+ <ul>
126
+ <li>Generate <a href="Cluster.html#M000058">start</a> and <a
127
+ href="Cluster.html#M000060">stop</a> commands and run them.
128
+
129
+ </li>
130
+ <li>Inject the port number in the pid and log filenames.
131
+
132
+ </li>
133
+ </ul>
134
+ <p>
135
+ Servers are started throught the <tt>thin</tt> commandline script.
136
+ </p>
137
+
138
+
139
+
140
+
141
+ <h4>Includes</h4>
142
+ <ul>
143
+ <li><a href="Logging.html">Logging</a></li>
144
+ </ul>
145
+
146
+ <h2 class="ruled">Methods</h2>
147
+ <h4 class="ruled">
148
+ <span class="method-type" title="Public Instance method">Public Instance</span>
149
+ <strong><a name="M000066" href="#M000066" title="Permalink to Public Instance method: running?">running?(pid)</a></strong>
150
+ </h4>
151
+
152
+ <p>
153
+ Returns <tt>true</tt> the process identied by <tt>pid</tt> is running.
154
+ </p>
155
+
156
+ <div class="sourcecode">
157
+ <p class="source-link">[ <a href="javascript:toggleSource('M000066_source')" id="l_M000066_source">show source</a> ]</p>
158
+ <div id="M000066_source" class="dyn-source">
159
+ <pre>
160
+ <span class="ruby-comment cmt"># File lib/thin/daemonizing.rb, line 6</span>
161
+ 6: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">running?</span>(<span class="ruby-identifier">pid</span>)
162
+ 7: <span class="ruby-constant">Process</span>.<span class="ruby-identifier">getpgid</span>(<span class="ruby-identifier">pid</span>) <span class="ruby-operator">!=</span> <span class="ruby-value">-1</span>
163
+ 8: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Errno</span><span class="ruby-operator">::</span><span class="ruby-constant">ESRCH</span>
164
+ 9: <span class="ruby-keyword kw">false</span>
165
+ 10: <span class="ruby-keyword kw">end</span>
166
+ </pre>
167
+ </div>
168
+ </div>
169
+
170
+ </div>
171
+ </div>
172
+
173
+
174
+ </div>
175
+ </div>
176
+ <div id="footer">
177
+ <hr />
178
+ &copy; <a href="http://macournoyer.com">Marc-Andr&eacute; Cournoyer</a>
179
+ </div>
180
+ </body>
181
+ </html>