thin 1.2.6-x86-mingw32
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +273 -0
- data/COPYING +18 -0
- data/README +69 -0
- data/Rakefile +39 -0
- data/benchmark/abc +51 -0
- data/benchmark/benchmarker.rb +80 -0
- data/benchmark/runner +82 -0
- data/bin/thin +6 -0
- data/example/adapter.rb +32 -0
- data/example/async_app.ru +126 -0
- data/example/async_chat.ru +247 -0
- data/example/async_tailer.ru +100 -0
- data/example/config.ru +22 -0
- data/example/monit_sockets +20 -0
- data/example/monit_unixsock +20 -0
- data/example/myapp.rb +1 -0
- data/example/ramaze.ru +12 -0
- data/example/thin.god +80 -0
- data/example/thin_solaris_smf.erb +36 -0
- data/example/thin_solaris_smf.readme.txt +150 -0
- data/example/vlad.rake +64 -0
- data/ext/thin_parser/common.rl +55 -0
- data/ext/thin_parser/ext_help.h +14 -0
- data/ext/thin_parser/extconf.rb +6 -0
- data/ext/thin_parser/parser.c +1185 -0
- data/ext/thin_parser/parser.h +49 -0
- data/ext/thin_parser/parser.rl +157 -0
- data/ext/thin_parser/thin.c +436 -0
- data/lib/rack/adapter/loader.rb +91 -0
- data/lib/rack/adapter/rails.rb +180 -0
- data/lib/thin.rb +46 -0
- data/lib/thin/backends/base.rb +141 -0
- data/lib/thin/backends/swiftiply_client.rb +56 -0
- data/lib/thin/backends/tcp_server.rb +29 -0
- data/lib/thin/backends/unix_server.rb +51 -0
- data/lib/thin/command.rb +53 -0
- data/lib/thin/connection.rb +222 -0
- data/lib/thin/controllers/cluster.rb +178 -0
- data/lib/thin/controllers/controller.rb +182 -0
- data/lib/thin/controllers/service.rb +75 -0
- data/lib/thin/controllers/service.sh.erb +39 -0
- data/lib/thin/daemonizing.rb +176 -0
- data/lib/thin/headers.rb +39 -0
- data/lib/thin/logging.rb +54 -0
- data/lib/thin/request.rb +157 -0
- data/lib/thin/response.rb +101 -0
- data/lib/thin/runner.rb +212 -0
- data/lib/thin/server.rb +248 -0
- data/lib/thin/stats.html.erb +216 -0
- data/lib/thin/stats.rb +52 -0
- data/lib/thin/statuses.rb +43 -0
- data/lib/thin/version.rb +32 -0
- data/lib/thin_parser.so +0 -0
- data/spec/backends/swiftiply_client_spec.rb +66 -0
- data/spec/backends/tcp_server_spec.rb +33 -0
- data/spec/backends/unix_server_spec.rb +37 -0
- data/spec/command_spec.rb +25 -0
- data/spec/configs/cluster.yml +9 -0
- data/spec/configs/single.yml +9 -0
- data/spec/connection_spec.rb +106 -0
- data/spec/controllers/cluster_spec.rb +267 -0
- data/spec/controllers/controller_spec.rb +129 -0
- data/spec/controllers/service_spec.rb +50 -0
- data/spec/daemonizing_spec.rb +192 -0
- data/spec/headers_spec.rb +40 -0
- data/spec/logging_spec.rb +46 -0
- data/spec/perf/request_perf_spec.rb +50 -0
- data/spec/perf/response_perf_spec.rb +19 -0
- data/spec/perf/server_perf_spec.rb +39 -0
- data/spec/rack/loader_spec.rb +42 -0
- data/spec/rack/rails_adapter_spec.rb +106 -0
- data/spec/rails_app/app/controllers/application.rb +10 -0
- data/spec/rails_app/app/controllers/simple_controller.rb +19 -0
- data/spec/rails_app/app/helpers/application_helper.rb +3 -0
- data/spec/rails_app/app/views/simple/index.html.erb +15 -0
- data/spec/rails_app/config/boot.rb +109 -0
- data/spec/rails_app/config/environment.rb +64 -0
- data/spec/rails_app/config/environments/development.rb +18 -0
- data/spec/rails_app/config/environments/production.rb +19 -0
- data/spec/rails_app/config/environments/test.rb +22 -0
- data/spec/rails_app/config/initializers/inflections.rb +10 -0
- data/spec/rails_app/config/initializers/mime_types.rb +5 -0
- data/spec/rails_app/config/routes.rb +35 -0
- data/spec/rails_app/public/404.html +30 -0
- data/spec/rails_app/public/422.html +30 -0
- data/spec/rails_app/public/500.html +30 -0
- data/spec/rails_app/public/dispatch.cgi +10 -0
- data/spec/rails_app/public/dispatch.fcgi +24 -0
- data/spec/rails_app/public/dispatch.rb +10 -0
- data/spec/rails_app/public/favicon.ico +0 -0
- data/spec/rails_app/public/images/rails.png +0 -0
- data/spec/rails_app/public/index.html +277 -0
- data/spec/rails_app/public/javascripts/application.js +2 -0
- data/spec/rails_app/public/javascripts/controls.js +963 -0
- data/spec/rails_app/public/javascripts/dragdrop.js +972 -0
- data/spec/rails_app/public/javascripts/effects.js +1120 -0
- data/spec/rails_app/public/javascripts/prototype.js +4225 -0
- data/spec/rails_app/public/robots.txt +5 -0
- data/spec/rails_app/script/about +3 -0
- data/spec/rails_app/script/console +3 -0
- data/spec/rails_app/script/destroy +3 -0
- data/spec/rails_app/script/generate +3 -0
- data/spec/rails_app/script/performance/benchmarker +3 -0
- data/spec/rails_app/script/performance/profiler +3 -0
- data/spec/rails_app/script/performance/request +3 -0
- data/spec/rails_app/script/plugin +3 -0
- data/spec/rails_app/script/process/inspector +3 -0
- data/spec/rails_app/script/process/reaper +3 -0
- data/spec/rails_app/script/process/spawner +3 -0
- data/spec/rails_app/script/runner +3 -0
- data/spec/rails_app/script/server +3 -0
- data/spec/request/mongrel_spec.rb +39 -0
- data/spec/request/parser_spec.rb +243 -0
- data/spec/request/persistent_spec.rb +35 -0
- data/spec/request/processing_spec.rb +50 -0
- data/spec/response_spec.rb +91 -0
- data/spec/runner_spec.rb +168 -0
- data/spec/server/builder_spec.rb +44 -0
- data/spec/server/pipelining_spec.rb +110 -0
- data/spec/server/robustness_spec.rb +34 -0
- data/spec/server/stopping_spec.rb +55 -0
- data/spec/server/swiftiply.yml +6 -0
- data/spec/server/swiftiply_spec.rb +32 -0
- data/spec/server/tcp_spec.rb +57 -0
- data/spec/server/threaded_spec.rb +27 -0
- data/spec/server/unix_socket_spec.rb +26 -0
- data/spec/server_spec.rb +100 -0
- data/spec/spec_helper.rb +219 -0
- data/tasks/announce.rake +22 -0
- data/tasks/deploy.rake +13 -0
- data/tasks/email.erb +30 -0
- data/tasks/gem.rake +66 -0
- data/tasks/rdoc.rake +25 -0
- data/tasks/site.rake +15 -0
- data/tasks/spec.rake +43 -0
- data/tasks/stats.rake +28 -0
- metadata +219 -0
data/CHANGELOG
ADDED
@@ -0,0 +1,273 @@
|
|
1
|
+
== 1.2.6 Crazy Delicious
|
2
|
+
* Make work with Rails 3 out-of-the-box.
|
3
|
+
* Auto-detect and load config.ru files on start. Makes Rails 3 work.
|
4
|
+
* Fix signals being ignored under 1.9 when daemonized.
|
5
|
+
|
6
|
+
== 1.2.5 This Is Not A Web Server
|
7
|
+
* Add rolling restart support (--onebyone option) [sikachu]
|
8
|
+
* Force external_encoding of request's body to ASCII_8BIT [jeremyz]
|
9
|
+
* Ensure Rack base API is used in Rails adapter only if version >= 2.3.2 [#111 state:resolved]
|
10
|
+
|
11
|
+
== 1.2.4 Flaming Astroboy
|
12
|
+
* Fix a few issues in thin to make it a better "gem citizen" [josh]
|
13
|
+
* Fix test for rack based Rails in adapter under Ruby >= 1.8.7 [#109 state:resolved]
|
14
|
+
* Fix Remote address spoofing vulnerability in Connection#remote_address [Alexey Borzenkov]
|
15
|
+
* Fix uninitialized constant ActionController::Dispatcher error with Rails 1.2.3 [Chris Anderton] [#103 state:resolved]
|
16
|
+
|
17
|
+
== 1.2.2 I Find Your Lack of Sauce Disturbing release
|
18
|
+
* Fix force kill under 1.9 [Alexey Chebotar]
|
19
|
+
* Fix regression when --only option is used w/ --socket.
|
20
|
+
* Add process name 'tag' functionality. Easier to distinguish thin daemons
|
21
|
+
from eachother in process listing [ctcherry]
|
22
|
+
|
23
|
+
== 1.2.1 Asynctilicious Ultra Supreme release
|
24
|
+
* Require Rack 1.0.0
|
25
|
+
* Require EventMachine 0.12.6
|
26
|
+
* Use Rails Rack based dispatcher when available
|
27
|
+
* Allow String for response body
|
28
|
+
* Require openssl before eventmachine to prevent crash in 1.9
|
29
|
+
|
30
|
+
== 1.2.0 Asynctilicious Supreme release
|
31
|
+
* Add support for Windows mingw Ruby distro [Juan C. Rodriguez]
|
32
|
+
* Add async response support, see example/async_*.ru [raggi]
|
33
|
+
|
34
|
+
== 1.1.1 Super Disco Power Plus release
|
35
|
+
* Fix bug when running with only options [hasimo]
|
36
|
+
|
37
|
+
== 1.1.0 Super Disco Power release
|
38
|
+
* Require EventMachine 0.12.4
|
39
|
+
* Remove Thin handler, now part of Rack 0.9.1
|
40
|
+
* Fix Rack protocol version to 0.1 in environment hash.
|
41
|
+
* Fix error when passing no_epoll option to a cluster.
|
42
|
+
* Omit parsing #defined strings [Jérémy Zurcher]
|
43
|
+
* Defaults SERVER_NAME to localhost like webrick does [#87 state:resolved]
|
44
|
+
* Namespace parser to prevent error when mongrel is required [cliffmoon]
|
45
|
+
* Set RACK_ENV based on environment option when loading rackup file [Curtis Summers] [#83 state:resolved]
|
46
|
+
* Fixes a warning RE relative_url_root when using a prefix with Rails 2.1.1 [seriph] [#85 state:resolved]
|
47
|
+
* --only can work as a sequence number (if < 80) or a port number (if >= 80) [jmay] [#81 state:resolved]
|
48
|
+
|
49
|
+
== 1.0.0 That's What She Said release
|
50
|
+
* Fixed vlad.rake to allow TCP or socket [hellekin]
|
51
|
+
* Updated Mack adapter to handle both <0.8.0 and >0.8.0 [Mark Bates]
|
52
|
+
* rails rack adapter uses File.readable_real? so it recognizes ACL permissions [Ricardo Chimal]
|
53
|
+
* Log a warning if Rack application returns nil body [Michael S. Klishin]
|
54
|
+
* Handle nil and Time header values correctly [#76 state:resolved] [tmm1]
|
55
|
+
* Add Content-Length header to response automatically when possible [#74 state:resolved] [dkubb]
|
56
|
+
* Runner now remembers -r, -D and -V parameters so that clustered servers inherit those and
|
57
|
+
`restart` keep your parameters.
|
58
|
+
* Make Set-Cookie header, in Rails adapter, compatible with current Rack spec [Pedro Belo]
|
59
|
+
[#73, state:resolved]
|
60
|
+
* Add --no-epoll option to disable epoll usage on Linux [#61 state:resolved]
|
61
|
+
* Add --force (-f) option to force stopping of a daemonized server [#72 state:resolved]
|
62
|
+
* Update halycon adapter loader [mtodd]
|
63
|
+
|
64
|
+
== 0.8.2 Double Margarita release
|
65
|
+
* Require EventMachine 0.12.0
|
66
|
+
* [bug] Fix timeout handling when running command
|
67
|
+
* [bug] Fix hanging when restarting and no process is running in single server move, fixes #67
|
68
|
+
* Added Mack adapter [markbates]
|
69
|
+
* Allow rackup .rb files by getting a conventionally named constant as the app [bmizerany]
|
70
|
+
|
71
|
+
== 0.8.1 Rebel Porpoise release
|
72
|
+
* [bug] Rescue all types of errors when processing request, fixes #62
|
73
|
+
* [bug] Use Swiftiply backend when -y option is specified, fixes #63 and #64
|
74
|
+
* Allow passing port as a string in Server.new
|
75
|
+
* Define deferred?(env) in your Rack application to set if a request is handled in a
|
76
|
+
thread (return true) or not (return false).
|
77
|
+
|
78
|
+
== 0.8.0 Dodgy Dentist release
|
79
|
+
* [bug] Fix server crash when header too large.
|
80
|
+
* Add --require (-r) option to require a library, before executing your script.
|
81
|
+
* Rename --rackup short option to -R, warn and load as rackup when file ends with .ru.
|
82
|
+
* List supported adapters in command usage.
|
83
|
+
* Add file adapter to built-in adapter, serve static files in current directory.
|
84
|
+
* Allow disabling signal handling in Server with :signals => false
|
85
|
+
* Make Server.new arguments more flexible, can now specify any of host, port, app or hash options.
|
86
|
+
* Add --backend option to specified which backend to use, closes #55
|
87
|
+
* [bug] Serve static file only on GET and HEAD requests in Rails adapter, fixes #58
|
88
|
+
* Add threaded option to run server in threaded mode, calling the application in a
|
89
|
+
thread allowing for concurrency in the Rack adapter, closes #46
|
90
|
+
* Guess which adapter to use from directory (chdir option)
|
91
|
+
or use specified one in 'adapter' option, re #47.
|
92
|
+
|
93
|
+
== 0.7.1 Fancy Pants release
|
94
|
+
* Clean stale PID files when starting as daemon, fixes #53 [Chu Yeow]
|
95
|
+
* Require EventMachine 0.11.0 for UNIX domain sockets. Until it's released, install from:
|
96
|
+
gem install eventmachine --source http://code.macournoyer.com
|
97
|
+
* Ruby 1.8.5 compatibility, closes #49 [Wincent Colaiuta]
|
98
|
+
* Move all EventMachine stuff out of Server, you can now create a Thin Backend that
|
99
|
+
does not depend on EventMachine.
|
100
|
+
* Rename Connector to Backend. Extend Thin::Backends::Base to implement your own.
|
101
|
+
* Fix high memory usage with big POST body, fixes #48
|
102
|
+
|
103
|
+
== 0.7.0 Spherical Cow release
|
104
|
+
* Add --max-persistent-conns option to sets the maximum number of persistent connections.
|
105
|
+
Set to 0 to disable Keep-Alive.
|
106
|
+
* INT signal now force stop and QUIT signal gracefully stops.
|
107
|
+
* Warn when descriptors table size can't be set as high as expected.
|
108
|
+
* Eval Rackup config file using top level bindings.
|
109
|
+
* Remove daemons gem dependency on Windows plateform, fixes #45.
|
110
|
+
* Change default timeout from 60 to 30 seconds.
|
111
|
+
* Add --max-conns option to sets the maximum number of file or socket descriptors that
|
112
|
+
your process may open, defaults to 1024.
|
113
|
+
* Tail logfile when stopping and restarting a demonized server, fixes #26.
|
114
|
+
* Wrap application in a Rack::CommonLogger adapter in debug mode.
|
115
|
+
* --debug (-D) option no longer set $DEBUG so logging will be less verbose
|
116
|
+
and Ruby won't be too strict, fixes #36.
|
117
|
+
* Deprecate Server#silent in favour of Logging.silent.
|
118
|
+
* Persistent connection (keep-alive) support.
|
119
|
+
* Fix -s option not being included in generated config file, fixes #37.
|
120
|
+
* Add Swiftiply support. Use w/ the --swiftiply (-y) option in the thin script,
|
121
|
+
closes #28 [Alex MacCaw]
|
122
|
+
|
123
|
+
== 0.6.4 Sexy Lobster release
|
124
|
+
* Fix error when stopping server on UNIX domain socket, fixes #42
|
125
|
+
* Rescue errors in Connection#get_peername more gracefully, setting REMOTE_ADDR to nil, fixes #43
|
126
|
+
|
127
|
+
== 0.6.3 Ninja Cookie release
|
128
|
+
* Add tasks for Vlad the Deployer in example/vlad.rake [cnantais]
|
129
|
+
* Add Ramaze Rackup config file in example dir [tmm1]
|
130
|
+
Use like this from you Ramaze app dir:
|
131
|
+
|
132
|
+
thin start -r /path/to/thin/example/ramaze.ru
|
133
|
+
|
134
|
+
* Add the --rackup option to load a Rack config file instead of the Rails adapter.
|
135
|
+
So you can use any framework with the thin script and start cluster and stuff like that.
|
136
|
+
A Rack config file is one that is usable through the rackup command and looks like this:
|
137
|
+
|
138
|
+
use Rack::CommonLogger
|
139
|
+
run MyCrazyRackAdapter.new(:uterly, 'cool')
|
140
|
+
|
141
|
+
Then use it with thin like this:
|
142
|
+
|
143
|
+
thin start --rackup config.ru
|
144
|
+
|
145
|
+
* thin config --chrdir ... -C thin/yml do not change current directory anymore, fixes #33.
|
146
|
+
* Add a better sample god config file in example/thin.god that loads all info from config
|
147
|
+
files in /etc/thin. Drop-in replacement for the thin runlevel service [Gump].
|
148
|
+
* Add support for specifying a custom Connector to the server and add more doc about Server
|
149
|
+
configuration.
|
150
|
+
* Add a script to run thin as a runlevel service that can start at startup, closes #31 [Gump]
|
151
|
+
Setup the service like this:
|
152
|
+
|
153
|
+
sudo thin install /etc/thin
|
154
|
+
|
155
|
+
This will install the boot script under /etc/init.d/thin. Then copy your config files to
|
156
|
+
/etc/thin. Works only under Linux.
|
157
|
+
* Set process name to 'thin server (0.0.0.0:3000)' when running as a daemon, closes #32.
|
158
|
+
* Make sure chdir option from config file is used when present.
|
159
|
+
* Raise an error when starting a server as a daemon and pid file already exist, fixes #27.
|
160
|
+
|
161
|
+
== 0.6.2 Rambo release
|
162
|
+
* Server now let current connections finish before stopping, fixes #18
|
163
|
+
* Fix uploading hanging bug when body is moved to a tempfile,
|
164
|
+
also delete the tempfile properly upon completion, fixes #25
|
165
|
+
* 'thin restart' now sends HUP signals rather then stopping & starting, closes #17
|
166
|
+
* HUP signal now launches a new process with the same options.
|
167
|
+
* Add PID and more info from the last request to the Stats adapter
|
168
|
+
mostly taken from Rack::ShowException.
|
169
|
+
* pid and log files in cluster are no longer required to be relative to the
|
170
|
+
app directory (chdir option), fixes #24
|
171
|
+
* Revert to using #each when building response headers under Ruby 1.8,
|
172
|
+
solves an issue w/ Camping adapter, fixes #22
|
173
|
+
* Restructure thin script options in 3 sections: server, daemon and cluster
|
174
|
+
* Add --only (-o) option to control only one server of a cluster.
|
175
|
+
* Stylize stats page and make the url configurable from the thin script.
|
176
|
+
* Raise error if attempting to use unix sockets on windows.
|
177
|
+
* Add example config files for http://www.tildeslash.com/monit usage.
|
178
|
+
Include the example file using "include /path/to/thin/monit/file" in your monitrc file.
|
179
|
+
The group settings let you do this to manage your clusters:
|
180
|
+
|
181
|
+
sudo monit -g blog restart all
|
182
|
+
|
183
|
+
There are examples of thin listening on sockets and thin listening on unix sockets.
|
184
|
+
|
185
|
+
== 0.6.1 Cheesecake release
|
186
|
+
* Remove socket file when server stops.
|
187
|
+
* Set back cluster to use 'thin' command to launch servers.
|
188
|
+
|
189
|
+
== 0.6.0 Big Pony release
|
190
|
+
* Add support for connection through UNIX domain socket.
|
191
|
+
Use the --socket (-S) option w/ the thin script to configure the socket filename.
|
192
|
+
Nginx support binding to a UNIX socket like this:
|
193
|
+
|
194
|
+
upstream backend {
|
195
|
+
server unix:/tmp/thin.0.sock;
|
196
|
+
server unix:/tmp/thin.1.sock;
|
197
|
+
server unix:/tmp/thin.2.sock;
|
198
|
+
}
|
199
|
+
|
200
|
+
Start your servers like this:
|
201
|
+
|
202
|
+
thin start -s3 -S/tmp/thin.sock
|
203
|
+
|
204
|
+
* Remove Server#listen! method. Use Server#start instead.
|
205
|
+
* Server can now yield a Rack::Builder to allow building an app in one call:
|
206
|
+
|
207
|
+
Server.start '0.0.0.0', 3000 do
|
208
|
+
use Rack::CommonLogger
|
209
|
+
use Rack::ShowExceptions
|
210
|
+
map "/lobster" do
|
211
|
+
use Rack::Lint
|
212
|
+
run Rack::Lobster.new
|
213
|
+
end
|
214
|
+
end
|
215
|
+
|
216
|
+
* Add a very basic stats page through Stats adapter, load w/ --stats and browse to /stats.
|
217
|
+
* Add --trace (-V) option to trace request/response and get backtrace w/out all Ruby debug stuff.
|
218
|
+
* Add --config (-C) option to load options from a config file in thin script [Matt Todd].
|
219
|
+
* Alter response headers to output directly to a string.
|
220
|
+
* Improve specs stability.
|
221
|
+
* Move request body to a Tempfile if too big (> 112 MB)
|
222
|
+
* Remove useless check for max header size in Request (already done in the parser)
|
223
|
+
|
224
|
+
== 0.5.4 Flying Mustard release
|
225
|
+
* Don't read the full body, use direct streaming when sending response.
|
226
|
+
See: Response#each
|
227
|
+
As a result, the Content-Length can not be calculated anymore.
|
228
|
+
You have to do set this in your adapter. All frameworks do it anyway.
|
229
|
+
It improve memory usage and boost speed for low concurrency.
|
230
|
+
Thanks to Kent Sibilev and Ezra for their help on that one.
|
231
|
+
* Add 'Server' response header
|
232
|
+
* Fix --user and --group option not changing daemon process privileges
|
233
|
+
|
234
|
+
== 0.5.3 Purple Yogurt release
|
235
|
+
* win32 pre-compiled gem now available
|
236
|
+
* change rake task configuration to allow win32 gem build
|
237
|
+
* Add prefix option to thin script to mount app under a given path.
|
238
|
+
|
239
|
+
== 0.5.2 Cheezburger release
|
240
|
+
* Add cluster support through the -s option in the thin script, start 3 thins like this:
|
241
|
+
thin start -s3 -p3000
|
242
|
+
3 thin servers will be started on port 3000, 3001, 3002, also the port number will be
|
243
|
+
injected in the pid and log filenames.
|
244
|
+
* Fix IOError when writing to logger when starting server as a daemon.
|
245
|
+
* Really change directory when the -c option is specified.
|
246
|
+
* Add restart command to thin script.
|
247
|
+
* Fix typos in thin script usage message and expand chdir path.
|
248
|
+
* Rename thin script options to be the same as mongrel_rails script [thronedrk]:
|
249
|
+
-o --host => -a --address
|
250
|
+
--log-file => --log
|
251
|
+
--pid-file => --pid
|
252
|
+
--env => --environment
|
253
|
+
|
254
|
+
== 0.5.1 LOLCAT release
|
255
|
+
* Add URL rewriting to Rails adapter so that page caching works and / fetches index.html if present.
|
256
|
+
* Fix bug in multiline response header parsing.
|
257
|
+
* Add specs for the Rails adapter.
|
258
|
+
* Fix Set-Cookie headers in Rails adapter to handle multiple values correctly.
|
259
|
+
* Fix Ruby 1.9 incompatibility in Response#headers= and Rakefile.
|
260
|
+
* Fix parser to be Ruby 1.9 compatible [Aman Gupta]
|
261
|
+
* Set gemspec to use EventMachine version 0.8.1 as it's the latest one having precompiled windows binaries.
|
262
|
+
[Francis Cianfrocca].
|
263
|
+
* Add -D option to thin script to set debugging on.
|
264
|
+
* Output incoming data and response when debugging is on.
|
265
|
+
|
266
|
+
== 0.5.0
|
267
|
+
* Full rewrite to use EventMachine, Rack and Mongrel parser
|
268
|
+
|
269
|
+
== 0.4.1
|
270
|
+
* Fix Rails environment option not being used in thin script.
|
271
|
+
|
272
|
+
== 0.4.0
|
273
|
+
* 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,69 @@
|
|
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
|
+
|
9
|
+
Which makes it, with all humility, the most secure, stable, fast and extensible Ruby web server
|
10
|
+
bundled in an easy to use gem for your own pleasure.
|
11
|
+
|
12
|
+
Site: http://code.macournoyer.com/thin/
|
13
|
+
Group: http://groups.google.com/group/thin-ruby/topics
|
14
|
+
Bugs: http://thin.lighthouseapp.com/projects/7212-thin
|
15
|
+
Code: http://github.com/macournoyer/thin
|
16
|
+
IRC: #thin on freenode
|
17
|
+
|
18
|
+
=== Installation
|
19
|
+
For the latest stable version:
|
20
|
+
|
21
|
+
sudo gem install thin
|
22
|
+
|
23
|
+
Or from source:
|
24
|
+
|
25
|
+
git clone git://github.com/macournoyer/thin.git
|
26
|
+
cd thin
|
27
|
+
rake install
|
28
|
+
|
29
|
+
=== Usage
|
30
|
+
A +thin+ script offers an easy way to start your Rails application:
|
31
|
+
|
32
|
+
cd to/your/rails/app
|
33
|
+
thin start
|
34
|
+
|
35
|
+
But Thin is also usable with a Rack config file.
|
36
|
+
You need to setup a config.ru file and pass it to the thin script:
|
37
|
+
|
38
|
+
cat config.ru
|
39
|
+
app = proc do |env|
|
40
|
+
[
|
41
|
+
200,
|
42
|
+
{
|
43
|
+
'Content-Type' => 'text/html',
|
44
|
+
'Content-Length' => '2'
|
45
|
+
},
|
46
|
+
['hi']
|
47
|
+
]
|
48
|
+
end
|
49
|
+
|
50
|
+
run app
|
51
|
+
|
52
|
+
thin start -R config.ru
|
53
|
+
|
54
|
+
See example directory for more samples and run 'thin -h' for usage.
|
55
|
+
|
56
|
+
=== License
|
57
|
+
Ruby License, http://www.ruby-lang.org/en/LICENSE.txt.
|
58
|
+
|
59
|
+
=== Credits
|
60
|
+
The parser was stolen from Mongrel http://mongrel.rubyforge.org by Zed Shaw.
|
61
|
+
Mongrel Web Server (Mongrel) is copyrighted free software by Zed A. Shaw
|
62
|
+
<zedshaw at zedshaw dot com> You can redistribute it and/or modify it under
|
63
|
+
either the terms of the GPL.
|
64
|
+
|
65
|
+
Thin is copyright Marc-Andre Cournoyer <macournoyer@gmail.com>
|
66
|
+
|
67
|
+
Get help at http://groups.google.com/group/thin-ruby/
|
68
|
+
Report bugs at http://thin.lighthouseapp.com/projects/7212-thin
|
69
|
+
and major security issues directly to a team member (see COMMITTERS)
|
data/Rakefile
ADDED
@@ -0,0 +1,39 @@
|
|
1
|
+
RUBY_1_9 = RUBY_VERSION =~ /^1\.9/
|
2
|
+
WIN = (RUBY_PLATFORM =~ /mswin|cygwin/)
|
3
|
+
SUDO = (WIN ? "" : "sudo")
|
4
|
+
|
5
|
+
require 'rake'
|
6
|
+
require 'rake/clean'
|
7
|
+
require 'rake/extensiontask' # from rake-compiler gem
|
8
|
+
|
9
|
+
$: << File.join(File.dirname(__FILE__), 'lib')
|
10
|
+
require 'thin'
|
11
|
+
|
12
|
+
# Load tasks in tasks/
|
13
|
+
Dir['tasks/**/*.rake'].each { |rake| load rake }
|
14
|
+
|
15
|
+
task :default => :spec
|
16
|
+
|
17
|
+
Rake::ExtensionTask.new('thin_parser', Thin::GemSpec) do |ext|
|
18
|
+
# enable cross compilation (requires cross compile toolchain)
|
19
|
+
ext.cross_compile = true
|
20
|
+
|
21
|
+
# forces the Windows platform instead of the default one
|
22
|
+
# configure options only for cross compile
|
23
|
+
ext.cross_platform = %w( i386-mswin32 x86-mingw32 )
|
24
|
+
end
|
25
|
+
|
26
|
+
CLEAN.include %w(**/*.{o,bundle,jar,so,obj,pdb,lib,def,exp,log} ext/*/Makefile ext/*/conftest.dSYM)
|
27
|
+
|
28
|
+
desc "Compile the Ragel state machines"
|
29
|
+
task :ragel do
|
30
|
+
Dir.chdir 'ext/thin_parser' do
|
31
|
+
target = "parser.c"
|
32
|
+
File.unlink target if File.exist? target
|
33
|
+
sh "ragel parser.rl -G2 -o #{target}"
|
34
|
+
raise "Failed to compile Ragel state machine" unless File.exist? target
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
desc "Release version #{Thin::VERSION::STRING} gems to rubyforge"
|
39
|
+
task :release => [:clean, :cross, :native, :gem, :tag, "gem:upload"]
|
data/benchmark/abc
ADDED
@@ -0,0 +1,51 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# Automate benchmarking with ab with various concurrency levels.
|
3
|
+
require 'optparse'
|
4
|
+
|
5
|
+
options = {
|
6
|
+
:address => '0.0.0.0',
|
7
|
+
:port => 3000,
|
8
|
+
:requests => 1000,
|
9
|
+
:start => 1,
|
10
|
+
:end => 100,
|
11
|
+
:step => 10
|
12
|
+
}
|
13
|
+
|
14
|
+
OptionParser.new do |opts|
|
15
|
+
opts.banner = "Usage: #{$PROGRAM_NAME} [options]"
|
16
|
+
|
17
|
+
opts.on("-n", "--requests NUM", "Number of requests") { |num| options[:requests] = num }
|
18
|
+
opts.on("-a", "--address HOST", "Address (default: 0.0.0.0)") { |host| options[:address] = host }
|
19
|
+
opts.on("-p", "--port PORT", "use PORT (default: 3000)") { |port| options[:port] = port.to_i }
|
20
|
+
opts.on("-s", "--start N", "First concurrency level") { |n| options[:start] = n.to_i }
|
21
|
+
opts.on("-e", "--end N", "Last concurrency level") { |n| options[:end] = n.to_i }
|
22
|
+
opts.on("-S", "--step N", "Concurrency level step") { |n| options[:step] = n.to_i }
|
23
|
+
opts.on("-u", "--uri PATH", "Path to send to") { |u| options[:uri] = u }
|
24
|
+
opts.on("-k", "--keep-alive", "Use Keep-Alive") { options[:keep_alive] = true }
|
25
|
+
|
26
|
+
opts.on_tail("-h", "--help", "Show this message") { puts opts; exit }
|
27
|
+
end.parse!(ARGV)
|
28
|
+
|
29
|
+
puts 'request concurrency req/s failures'
|
30
|
+
puts '=' * 42
|
31
|
+
|
32
|
+
c = options[:start]
|
33
|
+
until c >= options[:end]
|
34
|
+
sleep 0.5
|
35
|
+
out = `nice -n20 ab #{'-k' if options[:keep_alive]} -c #{c} -n #{options[:requests]} #{options[:address]}:#{options[:port]}/#{options[:uri]} 2> /dev/null`
|
36
|
+
|
37
|
+
r = if requests = out.match(/^Requests.+?(\d+\.\d+)/)
|
38
|
+
requests[1].to_i
|
39
|
+
else
|
40
|
+
0
|
41
|
+
end
|
42
|
+
f = if requests = out.match(/^Failed requests.+?(\d+)/)
|
43
|
+
requests[1].to_i
|
44
|
+
else
|
45
|
+
0
|
46
|
+
end
|
47
|
+
|
48
|
+
puts "#{options[:requests].to_s.ljust(9)} #{c.to_s.ljust(13)} #{r.to_s.ljust(8)} #{f}"
|
49
|
+
|
50
|
+
c += options[:step]
|
51
|
+
end
|