thin 1.6.4 → 2.0.0.pre

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 (107) hide show
  1. data/.gitignore +9 -0
  2. data/CHANGELOG +29 -94
  3. data/Gemfile +8 -0
  4. data/README.md +46 -148
  5. data/Rakefile +28 -18
  6. data/bin/thin +4 -4
  7. data/examples/async.ru +21 -0
  8. data/examples/thin.conf.rb +39 -0
  9. data/lib/thin.rb +2 -44
  10. data/lib/thin/async.rb +108 -0
  11. data/lib/thin/backends/prefork.rb +44 -0
  12. data/lib/thin/backends/single_process.rb +28 -0
  13. data/lib/thin/chunked_body.rb +28 -0
  14. data/lib/thin/configurator.rb +118 -0
  15. data/lib/thin/connection.rb +246 -172
  16. data/lib/thin/listener.rb +114 -0
  17. data/lib/thin/request.rb +94 -74
  18. data/lib/thin/response.rb +112 -45
  19. data/lib/thin/runner.rb +134 -194
  20. data/lib/thin/server.rb +203 -252
  21. data/lib/thin/system.rb +49 -0
  22. data/lib/thin/version.rb +14 -29
  23. data/man/index.txt +3 -0
  24. data/man/thin-conf.5.ronn +121 -0
  25. data/man/thin.1.ronn +105 -0
  26. data/site/.gitignore +2 -0
  27. data/site/README.md +21 -0
  28. data/site/Rakefile +20 -0
  29. data/site/config.ru +4 -0
  30. data/site/public/images/grid.png +0 -0
  31. data/site/public/javascripts/dd_belatedpng.js +13 -0
  32. data/site/public/javascripts/modernizr-1.6.min.js +30 -0
  33. data/site/public/man/thin-conf.5.html +220 -0
  34. data/site/public/man/thin.1.html +177 -0
  35. data/site/site/assets/javascripts/main.coffee +2 -0
  36. data/site/site/assets/stylesheets/_config.scss +55 -0
  37. data/site/site/assets/stylesheets/main.scss +24 -0
  38. data/site/site/helpers.rb +17 -0
  39. data/site/site/layouts/base.erb +55 -0
  40. data/site/site/layouts/default.erb +17 -0
  41. data/site/site/pages/about.md +5 -0
  42. data/site/site/pages/index.erb +10 -0
  43. data/site/site/partials/.gitkeep +0 -0
  44. data/test/fixtures/big.txt +1 -0
  45. data/test/fixtures/small.txt +1 -0
  46. data/test/fixtures/thin.conf.rb +15 -0
  47. data/test/integration/async_test.rb +35 -0
  48. data/test/integration/big_request_test.rb +30 -0
  49. data/test/integration/config.ru +57 -0
  50. data/test/integration/daemonize_test.rb +26 -0
  51. data/test/integration/env_test.rb +44 -0
  52. data/test/integration/error_test.rb +37 -0
  53. data/test/integration/file_sending_test.rb +24 -0
  54. data/test/integration/keep_alive_test.rb +35 -0
  55. data/test/integration/robustness_test.rb +37 -0
  56. data/test/integration/single_process_test.rb +15 -0
  57. data/test/integration/socket_family_test.rb +38 -0
  58. data/test/integration/worker_test.rb +22 -0
  59. data/test/test_helper.rb +195 -0
  60. data/test/unit/configurator_test.rb +43 -0
  61. data/test/unit/connection_test.rb +94 -0
  62. data/test/unit/listener_test.rb +74 -0
  63. data/test/unit/request_test.rb +74 -0
  64. data/test/unit/response_test.rb +90 -0
  65. data/test/unit/server_test.rb +29 -0
  66. data/test/unit/system_test.rb +17 -0
  67. data/thin.gemspec +26 -0
  68. data/v2.todo +21 -0
  69. metadata +134 -81
  70. checksums.yaml +0 -7
  71. data/example/adapter.rb +0 -32
  72. data/example/async_app.ru +0 -126
  73. data/example/async_chat.ru +0 -247
  74. data/example/async_tailer.ru +0 -100
  75. data/example/config.ru +0 -22
  76. data/example/monit_sockets +0 -20
  77. data/example/monit_unixsock +0 -20
  78. data/example/myapp.rb +0 -1
  79. data/example/ramaze.ru +0 -12
  80. data/example/thin.god +0 -80
  81. data/example/thin_solaris_smf.erb +0 -36
  82. data/example/thin_solaris_smf.readme.txt +0 -150
  83. data/example/vlad.rake +0 -72
  84. data/ext/thin_parser/common.rl +0 -59
  85. data/ext/thin_parser/ext_help.h +0 -14
  86. data/ext/thin_parser/extconf.rb +0 -6
  87. data/ext/thin_parser/parser.c +0 -1452
  88. data/ext/thin_parser/parser.h +0 -49
  89. data/ext/thin_parser/parser.rl +0 -157
  90. data/ext/thin_parser/thin.c +0 -435
  91. data/lib/rack/adapter/loader.rb +0 -75
  92. data/lib/rack/adapter/rails.rb +0 -178
  93. data/lib/thin/backends/base.rb +0 -167
  94. data/lib/thin/backends/swiftiply_client.rb +0 -56
  95. data/lib/thin/backends/tcp_server.rb +0 -29
  96. data/lib/thin/backends/unix_server.rb +0 -56
  97. data/lib/thin/command.rb +0 -53
  98. data/lib/thin/controllers/cluster.rb +0 -178
  99. data/lib/thin/controllers/controller.rb +0 -189
  100. data/lib/thin/controllers/service.rb +0 -76
  101. data/lib/thin/controllers/service.sh.erb +0 -39
  102. data/lib/thin/daemonizing.rb +0 -180
  103. data/lib/thin/headers.rb +0 -40
  104. data/lib/thin/logging.rb +0 -174
  105. data/lib/thin/stats.html.erb +0 -216
  106. data/lib/thin/stats.rb +0 -52
  107. data/lib/thin/statuses.rb +0 -44
@@ -0,0 +1,9 @@
1
+ *.gem
2
+ *.log
3
+ *.pid
4
+ .bundle
5
+ Gemfile.lock
6
+ pkg/*
7
+ tmp
8
+ .yardoc
9
+ test.conf.rb
data/CHANGELOG CHANGED
@@ -1,68 +1,3 @@
1
- == 1.6.4 Gob Bluth
2
- * Increase REQUEST_PATH to 2048 symbols [X2rdas]
3
- * Fix warning in logger [tenderlove]
4
- * Add :timeout option for Rack::Server.new [sugitak]
5
- * When restarting, exit on a next tick so we can send response back to a client [rsamoilov]
6
- * Check for empty PID files [z1dane]
7
- * Update Event Machine version to 1.0.4, Ruby 2.2.0 fix [freemanoid]
8
-
9
-
10
- == 1.6.3 Protein Powder
11
- * Add HTTP 422 status code [rajcybage]
12
- * Add warning about EM reactor still running when stopping.
13
- * Remove version number from "Server" HTTP header. [benbasson]
14
- * Adding `--ssl-disable-verify` to allow disabling of client cert requests when SSL enabled [brucek]
15
- * Ensure Tempfiles created by a large request are closed and deleted. [Tonkpils]
16
-
17
- == 1.6.2 Doc Brown
18
- * No longer replace response's body on HEAD request. Ensuring body.close will be called.
19
- * Remove `---ssl-verify` option as EventMachine doesn't verify the certificate.
20
- * Fix env['rack.peer_cert'] to return SSL certifcate.
21
-
22
- == 1.6.1 Death Proof
23
- * Regression: Default logger to STDOUT when using outside of CLI.
24
- * Regression: Downgrade Rack required version back to 1.0 to work w/ prior Rails versions.
25
-
26
- == 1.6.0 Greek Yogurt
27
- * Accept absolute URL in request line, eg.: 'GET http://site.com/he/lo HTTP/1.1'.
28
- * HEAD request no longer return a body in the response.
29
- * No longer stop EventMachine's reactor loop unless it was started by Thin.
30
- * Make request env keys upcasing locale-agnostic.
31
- * Use Ruby's `Logger` for logging. [Akshay Moghe].
32
- The logger can now be set using `Thin::Logging.logger=`.
33
- Tracing of request is handled by a second logger, `Thin::Logging.trace_logger=`.
34
- * Add --threadpool-size option to configure EM's thread pool size (default: 20).
35
- * Pipelining is no longer supported.
36
-
37
- == 1.5.1 Straight Razor
38
- * Fix issue when running as another user/group without a PID file.
39
- * Allow overriding Connection & Server response headers.
40
- * Update vlad example [Mathieu Lemoine]
41
- * Keep connections in a Hash to speedup deletion [slivu]
42
- * Force kill using already known pid. Prevents "thin stop" from leaving a process that removed its
43
- pid file, but is still running (e.g. hung on some at_exit callback) [Michal Kwiatkowski]
44
-
45
- == 1.5.0 Knife
46
- * Fix compilation under Ubuntu 12.04 with -Werror=format-security option.
47
- * Raise an error when no PID file.
48
- * Prevent duplicate response headers.
49
- * Make proper response on exception [MasterLambaster].
50
- * Automatically close idling pipeline connections on server stop [MasterLambaster].
51
-
52
- == 1.4.1 Chromeo Fix
53
- * Fix error when sending USR1 signal and no log file is supplied.
54
-
55
- == 1.4.0 Chromeo
56
- * kill -USR1 $PID for log rotation [catwell].
57
- * Fix HUP signal being reseted after deamonization [atotic].
58
- * Fix error with nil addresses in Connection#socket_address.
59
-
60
- == 1.3.2 Low-bar Squat
61
- * Remove mack and halcyon Rack adapters from automatic detection.
62
-
63
- == 1.3.1 Triple Espresso
64
- * Fix service not working pre 1.9.
65
-
66
1
  == 1.3.0 Double Espresso
67
2
  * BREAKING CHANGE: Thin no longer ships with fat Windows binaries.
68
3
  From now on, to install on Windows, install https://github.com/oneclick/rubyinstaller/wiki/Development-Kit.
@@ -70,10 +5,10 @@
70
5
  It is now the responsibility of the app (or a middleware) to set the Content-Length.
71
6
  * Log errors to STDERR [textgoeshere]
72
7
  * Shut down gracefully when receiving SIGTERM [ddollar]
73
-
8
+
74
9
  Processes are allowed a chance to shut down gracefully when receiving
75
10
  SIGTERM (http://en.wikipedia.org/wiki/SIGTERM).
76
-
11
+
77
12
  On Heroku, when shutting down a process, we send a SIGTERM followed 10
78
13
  seconds later with a SIGKILL, similar to the behavior of the init daemon
79
14
  on most Unix systems. This patch will allow Heroku apps to shut down
@@ -98,7 +33,7 @@
98
33
  the existing connection to another protocol, and specifically is NOT
99
34
  used to upgrade a separate connection. Therefore, the connection must
100
35
  remain open after this response in order to facilitate that.
101
-
36
+
102
37
  * Accept IE7 badly encoded URL (eg.: %uEEEE)
103
38
  * Fix gemspec to work w/ Bundler [smparkes]
104
39
  * Add SSL support [tmm1]
@@ -114,10 +49,10 @@
114
49
  --ssl-key-file PATH Path to private key
115
50
  --ssl-cert-file PATH Path to certificate
116
51
  --ssl-verify Enables SSL certificate verification
117
-
52
+
118
53
  * Expose peer SSL certificate in env (rack.peer_cert) [fd]
119
54
  * Adjusting unix socket permissions to be more open [mbj]
120
-
55
+
121
56
  == 1.2.7 No Hup
122
57
  * Support multiple Ruby version (fat binaries under windows)
123
58
  * Do not trap unsupported HUP signal on Windows
@@ -141,7 +76,7 @@
141
76
  == 1.2.2 I Find Your Lack of Sauce Disturbing release
142
77
  * Fix force kill under 1.9 [Alexey Chebotar]
143
78
  * Fix regression when --only option is used w/ --socket.
144
- * Add process name 'tag' functionality. Easier to distinguish thin daemons
79
+ * Add process name 'tag' functionality. Easier to distinguish thin daemons
145
80
  from eachother in process listing [ctcherry]
146
81
 
147
82
  == 1.2.1 Asynctilicious Ultra Supreme release
@@ -151,11 +86,11 @@
151
86
  * Allow String for response body
152
87
  * Require openssl before eventmachine to prevent crash in 1.9
153
88
 
154
- == 1.2.0 Asynctilicious Supreme release
89
+ == 1.2.0 Asynctilicious Supreme release
155
90
  * Add support for Windows mingw Ruby distro [Juan C. Rodriguez]
156
91
  * Add async response support, see example/async_*.ru [raggi]
157
92
 
158
- == 1.1.1 Super Disco Power Plus release
93
+ == 1.1.1 Super Disco Power Plus release
159
94
  * Fix bug when running with only options [hasimo]
160
95
 
161
96
  == 1.1.0 Super Disco Power release
@@ -252,20 +187,20 @@
252
187
  * Add tasks for Vlad the Deployer in example/vlad.rake [cnantais]
253
188
  * Add Ramaze Rackup config file in example dir [tmm1]
254
189
  Use like this from you Ramaze app dir:
255
-
190
+
256
191
  thin start -r /path/to/thin/example/ramaze.ru
257
-
192
+
258
193
  * Add the --rackup option to load a Rack config file instead of the Rails adapter.
259
194
  So you can use any framework with the thin script and start cluster and stuff like that.
260
195
  A Rack config file is one that is usable through the rackup command and looks like this:
261
-
196
+
262
197
  use Rack::CommonLogger
263
198
  run MyCrazyRackAdapter.new(:uterly, 'cool')
264
-
199
+
265
200
  Then use it with thin like this:
266
-
201
+
267
202
  thin start --rackup config.ru
268
-
203
+
269
204
  * thin config --chrdir ... -C thin/yml do not change current directory anymore, fixes #33.
270
205
  * Add a better sample god config file in example/thin.god that loads all info from config
271
206
  files in /etc/thin. Drop-in replacement for the thin runlevel service [Gump].
@@ -273,9 +208,9 @@
273
208
  configuration.
274
209
  * Add a script to run thin as a runlevel service that can start at startup, closes #31 [Gump]
275
210
  Setup the service like this:
276
-
211
+
277
212
  sudo thin install /etc/thin
278
-
213
+
279
214
  This will install the boot script under /etc/init.d/thin. Then copy your config files to
280
215
  /etc/thin. Works only under Linux.
281
216
  * Set process name to 'thin server (0.0.0.0:3000)' when running as a daemon, closes #32.
@@ -301,9 +236,9 @@
301
236
  * Add example config files for http://www.tildeslash.com/monit usage.
302
237
  Include the example file using "include /path/to/thin/monit/file" in your monitrc file.
303
238
  The group settings let you do this to manage your clusters:
304
-
239
+
305
240
  sudo monit -g blog restart all
306
-
241
+
307
242
  There are examples of thin listening on sockets and thin listening on unix sockets.
308
243
 
309
244
  == 0.6.1 Cheesecake release
@@ -314,20 +249,20 @@
314
249
  * Add support for connection through UNIX domain socket.
315
250
  Use the --socket (-S) option w/ the thin script to configure the socket filename.
316
251
  Nginx support binding to a UNIX socket like this:
317
-
252
+
318
253
  upstream backend {
319
254
  server unix:/tmp/thin.0.sock;
320
255
  server unix:/tmp/thin.1.sock;
321
256
  server unix:/tmp/thin.2.sock;
322
257
  }
323
-
258
+
324
259
  Start your servers like this:
325
-
260
+
326
261
  thin start -s3 -S/tmp/thin.sock
327
-
262
+
328
263
  * Remove Server#listen! method. Use Server#start instead.
329
264
  * Server can now yield a Rack::Builder to allow building an app in one call:
330
-
265
+
331
266
  Server.start '0.0.0.0', 3000 do
332
267
  use Rack::CommonLogger
333
268
  use Rack::ShowExceptions
@@ -336,13 +271,13 @@
336
271
  run Rack::Lobster.new
337
272
  end
338
273
  end
339
-
274
+
340
275
  * Add a very basic stats page through Stats adapter, load w/ --stats and browse to /stats.
341
276
  * Add --trace (-V) option to trace request/response and get backtrace w/out all Ruby debug stuff.
342
277
  * Add --config (-C) option to load options from a config file in thin script [Matt Todd].
343
278
  * Alter response headers to output directly to a string.
344
279
  * Improve specs stability.
345
- * Move request body to a Tempfile if too big (> 112 KB)
280
+ * Move request body to a Tempfile if too big (> 112 MB)
346
281
  * Remove useless check for max header size in Request (already done in the parser)
347
282
 
348
283
  == 0.5.4 Flying Mustard release
@@ -354,7 +289,7 @@
354
289
  Thanks to Kent Sibilev and Ezra for their help on that one.
355
290
  * Add 'Server' response header
356
291
  * Fix --user and --group option not changing daemon process privileges
357
-
292
+
358
293
  == 0.5.3 Purple Yogurt release
359
294
  * win32 pre-compiled gem now available
360
295
  * change rake task configuration to allow win32 gem build
@@ -374,7 +309,7 @@
374
309
  --log-file => --log
375
310
  --pid-file => --pid
376
311
  --env => --environment
377
-
312
+
378
313
  == 0.5.1 LOLCAT release
379
314
  * Add URL rewriting to Rails adapter so that page caching works and / fetches index.html if present.
380
315
  * Fix bug in multiline response header parsing.
@@ -389,9 +324,9 @@
389
324
 
390
325
  == 0.5.0
391
326
  * Full rewrite to use EventMachine, Rack and Mongrel parser
392
-
327
+
393
328
  == 0.4.1
394
329
  * Fix Rails environment option not being used in thin script.
395
-
330
+
396
331
  == 0.4.0
397
332
  * First alphaish release as a gem.
data/Gemfile ADDED
@@ -0,0 +1,8 @@
1
+ source "http://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in thin.gemspec
4
+ gemspec
5
+
6
+ group :test do
7
+ gem "mocha", "~> 0.10.0"
8
+ end
data/README.md CHANGED
@@ -1,170 +1,68 @@
1
- Thin
2
- ====
1
+ ---
3
2
 
4
- Tiny, fast & funny HTTP server
3
+ # This is alpha software. Things might break, people will cry and it will be your fault.
4
+ ### When reporting issues, make sure to mention you're using Thin v2.
5
5
 
6
- Thin is a Ruby web server that glues together 3 of the best Ruby libraries in web history:
6
+ ---
7
7
 
8
- * The Mongrel parser: the root of Mongrel speed and security
9
- * Event Machine: a network I/O library with extremely high scalability, performance and stability
10
- * Rack: a minimal interface between webservers and Ruby frameworks
8
+ # Thin
9
+ Tiny, fast & funny Ruby server
10
+
11
+ Thin is a high performance and customizable Ruby server. It's structured much like Nginx. A
12
+ master process listen to incoming requests and dispatch to its worker processes, each one
13
+ running an EventMachine event loop.
11
14
 
12
15
  Which makes it, with all humility, the most secure, stable, fast and extensible Ruby web server
13
16
  bundled in an easy to use gem for your own pleasure.
14
17
 
15
- Site: http://code.macournoyer.com/thin/
16
- Group: http://groups.google.com/group/thin-ruby/topics
17
- Bugs: http://github.com/macournoyer/thin/issues
18
- Code: http://github.com/macournoyer/thin
19
- IRC: #thin on freenode
18
+ **Site:** http://code.macournoyer.com/thin/
19
+ **Group:** http://groups.google.com/group/thin-ruby/topics
20
+ **Bugs:** http://github.com/macournoyer/thin/issues
21
+ **Code:** http://github.com/macournoyer/thin
22
+ **IRC:** #thin on freenode
20
23
 
21
- ## Installation
24
+ ## Features
25
+
26
+ * Prefork model with an EventMachine loop running in each worker.
27
+ * Optional single process mode for non-UNIX systems and simpler deployments.
28
+ * Optional threaded mode using a pool of threads.
29
+ * Easy asynchronous streaming response support with chunked encoding.
30
+ * Fast file serving with automatic streaming for large files.
31
+ * Keep-alive support.
32
+ * SSL support (upcoming).
22
33
 
23
- For the latest stable version:
34
+ ## Installation
35
+ For this pre-release of version 2.0:
24
36
 
25
- `gem install thin`
37
+ $ gem install thin --pre
26
38
 
27
39
  Or from source:
28
40
 
29
- ```
30
- git clone git://github.com/macournoyer/thin.git
31
- cd thin
32
- rake install
33
- ```
41
+ $ git clone git://github.com/macournoyer/thin.git
42
+ $ git checkout v2
43
+ $ cd thin
44
+ $ bundle install
45
+ $ rake install
34
46
 
35
47
  ## Usage
48
+ The `thin` script offers an easy way to start your Rack based application and acts just like
49
+ the `rackup` script.:
36
50
 
37
- A +thin+ script offers an easy way to start your Rack application:
38
-
39
- ```
40
- cd to/your/app
41
- thin start
42
- ```
43
-
44
- When using with Rails and Bundler, make sure to add `gem 'thin'`
45
- to your Gemfile.
46
-
47
- See example directory for samples.
48
-
49
- ### Command Line Examples
50
-
51
- Use a rackup file and bind to localhost port 8080:
52
-
53
- ```
54
- thin -R config.ru -a 127.0.0.1 -p 8080 start
55
- ```
56
-
57
- Store the server process ID, log to a file and daemonize:
58
-
59
- ```
60
- thin -p 9292 -P tmp/pids/thin.pid -l logs/thin.log -d start
61
- ```
62
-
63
- Thin is quite flexible in that many options can be specified at the command line (see below for usage).
64
-
65
- ### Configuration files
66
-
67
- You can create configuration files in yaml format and feed them to thin using `thin -C config.yml`. Here is an example config file:
68
-
69
- ```yaml
70
- ---
71
- user: www-data
72
- group: www-data
73
- pid: tmp/pids/thin.pid
74
- timeout: 30
75
- wait: 30
76
- log: log/thin.log
77
- max_conns: 1024
78
- require: []
79
- environment: production
80
- max_persistent_conns: 512
81
- servers: 1
82
- threaded: true
83
- no-epoll: true
84
- daemonize: true
85
- socket: tmp/sockets/thin.sock
86
- chdir: /path/to/your/apps/root
87
- tag: a-name-to-show-up-in-ps aux
88
- ```
89
-
90
- ### Command Line Options
91
-
92
- This is the usage for the thin command which can be obtained by running `thin -h` at the command line.
93
-
94
- ```sh
95
- Usage: thin [options] start|stop|restart|config|install
96
-
97
- Server options:
98
- -a, --address HOST bind to HOST address (default: 0.0.0.0)
99
- -p, --port PORT use PORT (default: 3000)
100
- -S, --socket FILE bind to unix domain socket
101
- -y, --swiftiply [KEY] Run using swiftiply
102
- -A, --adapter NAME Rack adapter to use (default: autodetect)
103
- (rack, rails, ramaze, merb, file)
104
- -R, --rackup FILE Load a Rack config file instead of Rack adapter
105
- -c, --chdir DIR Change to dir before starting
106
- --stats PATH Mount the Stats adapter under PATH
107
-
108
- SSL options:
109
- --ssl Enables SSL
110
- --ssl-key-file PATH Path to private key
111
- --ssl-cert-file PATH Path to certificate
112
- --ssl-disable-verify Disables (optional) client cert requests
113
-
114
- Adapter options:
115
- -e, --environment ENV Framework environment (default: development)
116
- --prefix PATH Mount the app under PATH (start with /)
117
-
118
- Daemon options:
119
- -d, --daemonize Run daemonized in the background
120
- -l, --log FILE File to redirect output (default: /home/robert/log/thin.log)
121
- -P, --pid FILE File to store PID (default: tmp/pids/thin.pid)
122
- -u, --user NAME User to run daemon as (use with -g)
123
- -g, --group NAME Group to run daemon as (use with -u)
124
- --tag NAME Additional text to display in process listing
125
-
126
- Cluster options:
127
- -s, --servers NUM Number of servers to start
128
- -o, --only NUM Send command to only one server of the cluster
129
- -C, --config FILE Load options from config file
130
- --all [DIR] Send command to each config files in DIR
131
- -O, --onebyone Restart the cluster one by one (only works with restart command)
132
- -w, --wait NUM Maximum wait time for server to be started in seconds (use with -O)
133
-
134
- Tuning options:
135
- -b, --backend CLASS Backend to use, full classname
136
- -t, --timeout SEC Request or command timeout in sec (default: 30)
137
- -f, --force Force the execution of the command
138
- --max-conns NUM Maximum number of open file descriptors (default: 1024)
139
- Might require sudo to set higher than 1024
140
- --max-persistent-conns NUM Maximum number of persistent connections
141
- (default: 100)
142
- --threaded Call the Rack application in threads [experimental]
143
- --threadpool-size NUM Sets the size of the EventMachine threadpool.
144
- (default: 20)
145
- --no-epoll Disable the use of epoll
146
-
147
- Common options:
148
- -r, --require FILE require the library
149
- -q, --quiet Silence all logging
150
- -D, --debug Enable debug logging
151
- -V, --trace Set tracing on (log raw request/response)
152
- -h, --help Show this message
153
- -v, --version Show version
154
- ```
51
+ $ cd to/your/rack/app
52
+ $ thin
155
53
 
156
- ## License
54
+ To use with Rails, add thin to your Gemfile and use Rails server command:
157
55
 
158
- Ruby License, http://www.ruby-lang.org/en/LICENSE.txt.
56
+ $ echo "gem 'thin'" >> Gemfile
57
+ $ bundle install
58
+ $ rails server thin
159
59
 
160
- ## Credits
60
+ See examples/thin.conf.rb for a sample configuration file.
161
61
 
162
- The parser was stolen from Mongrel http://mongrel.rubyforge.org by Zed Shaw.
163
- Mongrel is copyright 2007 Zed A. Shaw and contributors. It is licensed under
164
- the Ruby license and the GPL2.
62
+ Run `thin -h` to list available options.
165
63
 
166
- Thin is copyright Marc-Andre Cournoyer <macournoyer@gmail.com>
64
+ ## License
65
+ Ruby License, http://www.ruby-lang.org/en/LICENSE.txt.
167
66
 
168
- Get help at http://groups.google.com/group/thin-ruby/
169
- Report bugs at https://github.com/macournoyer/thin/issues
170
- and major security issues directly to me macournoyer@gmail.com.
67
+ ## Credits
68
+ Thin is copyright Marc-Andre Cournoyer <macournoyer@gmail.com>