thin 1.8.0 → 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 (108) hide show
  1. data/.gitignore +9 -0
  2. data/CHANGELOG +29 -107
  3. data/Gemfile +8 -0
  4. data/README.md +44 -78
  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 -76
  18. data/lib/thin/response.rb +112 -45
  19. data/lib/thin/runner.rb +134 -197
  20. data/lib/thin/server.rb +203 -252
  21. data/lib/thin/system.rb +49 -0
  22. data/lib/thin/version.rb +11 -26
  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 +138 -93
  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 -1447
  88. data/ext/thin_parser/parser.h +0 -49
  89. data/ext/thin_parser/parser.rl +0 -152
  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/rack/handler/thin.rb +0 -38
  94. data/lib/thin/backends/base.rb +0 -169
  95. data/lib/thin/backends/swiftiply_client.rb +0 -56
  96. data/lib/thin/backends/tcp_server.rb +0 -34
  97. data/lib/thin/backends/unix_server.rb +0 -56
  98. data/lib/thin/command.rb +0 -53
  99. data/lib/thin/controllers/cluster.rb +0 -178
  100. data/lib/thin/controllers/controller.rb +0 -189
  101. data/lib/thin/controllers/service.rb +0 -76
  102. data/lib/thin/controllers/service.sh.erb +0 -39
  103. data/lib/thin/daemonizing.rb +0 -199
  104. data/lib/thin/headers.rb +0 -40
  105. data/lib/thin/logging.rb +0 -174
  106. data/lib/thin/stats.html.erb +0 -216
  107. data/lib/thin/stats.rb +0 -52
  108. data/lib/thin/statuses.rb +0 -48
@@ -0,0 +1,49 @@
1
+ module Thin
2
+ module System
3
+ def self.win?
4
+ RUBY_PLATFORM =~ /mswin|mingw/
5
+ end
6
+
7
+ def self.java?
8
+ RUBY_PLATFORM =~ /java/
9
+ end
10
+
11
+ def self.linux?
12
+ RUBY_PLATFORM =~ /linux/
13
+ end
14
+
15
+ def self.ruby_18?
16
+ RUBY_VERSION =~ /^1\.8/
17
+ end
18
+
19
+ # Source: https://github.com/grosser/parallel/blob/master/lib/parallel.rb#L65-84
20
+ def self.processor_count
21
+ architecture = RbConfig::CONFIG['host_os']
22
+ case architecture = RbConfig::CONFIG['host_os']
23
+ when /darwin9/
24
+ `hwprefs cpu_count`.to_i
25
+ when /darwin/
26
+ (`which hwprefs` != '' ? `hwprefs thread_count` : `sysctl -n hw.ncpu`).to_i
27
+ when /linux/
28
+ `grep -c processor /proc/cpuinfo`.to_i
29
+ when /freebsd/
30
+ `sysctl -n hw.ncpu`.to_i
31
+ when /mswin|mingw/
32
+ require 'win32ole'
33
+ wmi = WIN32OLE.connect("winmgmts://")
34
+ cpu = wmi.ExecQuery("select NumberOfLogicalProcessors from Win32_Processor")
35
+ cpu.to_enum.first.NumberOfLogicalProcessors
36
+ else
37
+ warn "Unknown architecture ( #{architecture} ) assuming one processor."
38
+ 1
39
+ end
40
+ end
41
+
42
+ def self.supports_fork?
43
+ fork { exit }
44
+ true
45
+ rescue NotImplementedError
46
+ false
47
+ end
48
+ end
49
+ end
@@ -1,32 +1,17 @@
1
1
  module Thin
2
- # Raised when a feature is not supported on the
3
- # current platform.
4
- class PlatformNotSupported < RuntimeError; end
5
-
6
- module VERSION #:nodoc:
7
- MAJOR = 1
8
- MINOR = 8
2
+ module VERSION
3
+ MAJOR = 2
4
+ MINOR = 0
9
5
  TINY = 0
10
-
11
- STRING = [MAJOR, MINOR, TINY].join('.')
12
-
13
- CODENAME = "Possessed Pickle".freeze
14
-
15
- RACK = [1, 0].freeze # Rack protocol version
6
+ PRE = "pre"
7
+
8
+ STRING = [MAJOR, MINOR, TINY, PRE].compact.join('.')
9
+
10
+ CODENAME = "The Wire Burner".freeze
11
+
12
+ RACK = [1, 1].freeze # Rack protocol version
16
13
  end
17
-
14
+
18
15
  NAME = 'thin'.freeze
19
16
  SERVER = "#{NAME} #{VERSION::STRING} codename #{VERSION::CODENAME}".freeze
20
-
21
- def self.win?
22
- RUBY_PLATFORM =~ /mswin|mingw/
23
- end
24
-
25
- def self.linux?
26
- RUBY_PLATFORM =~ /linux/
27
- end
28
-
29
- def self.ruby_18?
30
- RUBY_VERSION =~ /^1\.8/
31
- end
32
17
  end
@@ -0,0 +1,3 @@
1
+ # manuals
2
+ thin(1) thin.1.ronn
3
+ thin-conf(5) thin-conf.5.ronn
@@ -0,0 +1,121 @@
1
+ thin-conf(5) -- Configuration file for the Thin Ruby server
2
+ ===========================================================
3
+
4
+ ## SYNOPSIS
5
+
6
+ A file used to configure a Thin server. This file is to be passed to the `-c` option of thin(1).
7
+
8
+ ## SYNTAX
9
+
10
+ A Thin configuration file is evaluated as Ruby code, in a context which makes available
11
+ a number of methods used to configure the server.
12
+
13
+ ## WORKER PROCESSES (#worker_processes)
14
+
15
+ Number of child worker processes.
16
+ Setting this to 0 will result in running in a single process with limited features.
17
+
18
+ worker_processes 4
19
+
20
+ Default: number of processors available, or `1` in development, or `0` if `fork(2)` is not available.
21
+
22
+ ## WORKER CONNECTIONS (#worker_connections)
23
+
24
+ Maximum number of file descriptors that a worker may open. This includes socket and file descriptors.
25
+
26
+ worker_connections 1024
27
+
28
+ Default: 1024.
29
+
30
+ ## LISTEN (#listen)
31
+
32
+ Listen for incoming connections on a given address.
33
+
34
+ listen 3000
35
+ listen "0.0.0.0:8008", :backlog => 80
36
+
37
+ # IPv6 address
38
+ listen "[::]:8008", :ipv6_only => true
39
+
40
+ # Unix domain sockets
41
+ listen "/tmp/thin.sock"
42
+
43
+ ### OPTIONS
44
+
45
+ * `tcp_no_delay`:
46
+ Disables the Nagle algorithm for send coalescing. Default: `true`.
47
+
48
+ * `tcp_no_push`:
49
+ Allows the use of the socket options TCP_NOPUSH on FreeBSD or TCP_CORK on Linux.
50
+ Setting this option causes Thin to attempt to send it's HTTP response headers in one packet on Linux and FreeBSD 4.x. Default: `false`.
51
+
52
+ * `ipv6_only`:
53
+ Do not listen on IPv4 interface. Default: `false`.
54
+
55
+ * `backlog`:
56
+ Maximum number of clients in the listening backlog. Default: `1024`
57
+
58
+ ## PRELOAD APP (#preload_app)
59
+
60
+ Set to `true` to load the app before forking to workers. Default: `false`. If the Ruby interpreter garbage collector doesn't support copy on write, set this option to false which will prevent loading your application in the master process. If the interpreter does support copy on write, setting this to `true` will help save memory.
61
+
62
+ Default: `false`.
63
+
64
+ ## TIMEOUT (#timeout)
65
+
66
+ Number of seconds before an inactive connection is closed.
67
+ Workers are also killed if they don't check-in under this amount of seconds.
68
+
69
+ ## KEEP-ALIVE REQUESTS (#keep_alive_requests)
70
+
71
+ Maximum number of concurrent requests which can be made over a keep-alive connection.
72
+
73
+ Default: `100`.
74
+
75
+ ## THREADED MODE (#threaded, #thread_pool_size)
76
+
77
+ Use threads to process the requests. The Rack app will be called inside a thread. Threads are pooled, you can control the minimum size of that pool using the `thread_pool_size` option.
78
+
79
+ threaded true
80
+ thread_pool_size 20
81
+
82
+ Defaults: `threaded`: `false`, `thread_pool_size`: `20`.
83
+
84
+ ## LOG PATH (#log_path)
85
+
86
+ Path to the file in which standard output streams are redirected.
87
+
88
+ log_path "my_app.log"
89
+
90
+ By default standard output streams are not redirected.
91
+
92
+ ## PID PATH (#pid_path)
93
+
94
+ Path to the file in which the PID is saved.
95
+
96
+ pid_path "my_app.pid"
97
+
98
+ Default: `./thin.pid`.
99
+
100
+ ## EVENT MODEL (#use_epoll, #use_kqueue)
101
+
102
+ Force or disable an event model in EventMachine.
103
+
104
+ use_epoll false
105
+
106
+ Epoll is used under Linux systems and Kqueue is used mainly under Mac OS X. Disabling will result in using select(2).
107
+
108
+ ## CALLBACKS (#before_fork, #after_fork)
109
+
110
+ Blocks of Ruby code executed before or after forking a worker process. `before_fork` will be called inside the master process and `after_fork` will be called inside a worker process.
111
+
112
+ before_fork do |server|
113
+ # ...
114
+ end
115
+
116
+ before_fork do |server, worker|
117
+ # ...
118
+ end
119
+
120
+ The `server` argument is an instance of `Thin::Server` from which you get access to all the configuration. `worker` has `kill` method to exist gracefully.
121
+
@@ -0,0 +1,105 @@
1
+ thin(1) -- high performance Ruby server
2
+ =======================================
3
+
4
+ ## SYNOPSIS
5
+
6
+ `thin` [options] [<config.ru>]<br>
7
+ `thin` `-c` <thin.conf.rb> [<config.ru>]
8
+
9
+ ## DESCRIPTION
10
+
11
+ Thin is a high performance Ruby server. Thin is generally used as an app server for serving [Rack applications](http://rack.rubyforge.org/doc/SPEC.html) behind full blown HTTP servers such as [nginx](http://nginx.org).
12
+
13
+ ## FILES
14
+
15
+ The `thin` command will load the Rack application defined in a rackup config file. The default behaviour is to look for a file named `config.ru` that lives at the root of the application if the argument is omitted. This file is evaluated in the context of a [Rack::Builder](http://rack.rubyforge.org/doc/Rack/Builder.html) class.
16
+
17
+ The `thin` command can also take a server configuration file with the `-c` option. See thin-conf(5) for the format of this file.
18
+
19
+ ## OPTIONS
20
+
21
+ These options control the Ruby environment and are the same as the `ruby` and `rackup` commands.
22
+
23
+ * `-e`, `--eval` <LINE>:
24
+ Evaluate a LINE of Ruby code.
25
+
26
+ * `-d`, `--debug`:
27
+ Set debugging flags (set $DEBUG to true). This is also output the request and response to stdout.
28
+
29
+ * `-w`, `--warn`:
30
+ Turn warnings on for your script.
31
+
32
+ * `-I`, `--include` <PATH>:
33
+ Add a path to the $LOAD_PATH. May be used more than once.
34
+
35
+ * `-r`, `--require` <LIBRARY>:
36
+ Require the library, before executing your script. May be used more than once.
37
+
38
+ These options control the Thin server.
39
+
40
+ * `-o`, `--host` <HOST>:
41
+ Bind to HOST. Leave blank to bind to any address. Use *[...]* to specify IPv6 addresses.
42
+
43
+ * `-p`, `--PORT` <PORT>:
44
+ Bind to PORT.
45
+
46
+ * `-E`, `--env` <ENVIRONMENT>:
47
+ Use the Rack ENVIRONMENT.
48
+
49
+ *deployment*:
50
+ will load the *ContentLength*, *Chunked* and *CommonLogger* middlewares.<br>
51
+ *development*:
52
+ will load the sames middlewares as *deployment* with the addition of *ShowExceptions* and *Lint*.
53
+
54
+ Any other environment will not load any middleware. This option will also set the *RACK_ENV* environment variable.
55
+
56
+ * `-D`, `--daemonize`:
57
+ Run daemonized in the background.
58
+
59
+ * `-P`, `--pid` <FILE>:
60
+ File to store the process ID in.
61
+
62
+ * `-l`, `--log` <FILE>:
63
+ File to redirect stdout and stderr to.
64
+
65
+ * `-c`, `--config` <FILE>:
66
+ Configure the Thin server by evaling this configuration file. See thin-conf(5) for the format of that file.
67
+
68
+ ## SIGNALS
69
+
70
+ Thin master process can handle the following signals.
71
+
72
+ * `WINCH`:
73
+ Gracefully kill all workers but keep master alive
74
+
75
+ * `TTIN`:
76
+ Increase number of workers
77
+
78
+ * `TTOU`:
79
+ Decrease number of workers
80
+
81
+ * `QUIT`:
82
+ Kill workers and master in a graceful way
83
+
84
+ * `TERM`, `INT`:
85
+ Kill workers and master immediately
86
+
87
+ ## MODES
88
+
89
+ By default Thin is a preforking server like Nginx and Unicorn. On systems where fork(2) is not supported, Thin will fallback to running in a single process. While running in this mode, a number of features are not supported.
90
+
91
+ Here is the list of features that do **NOT** work when running in single process mode.
92
+
93
+ * Signals, except `TERM` and `INT`.
94
+ * Run daemonized in the background (`-D` option).
95
+ * Log file (`-l` option).
96
+
97
+ Single process mode can also be forced by setting the number of worker processes to *0*.
98
+
99
+ ## COPYRIGHT
100
+
101
+ Thin is Copyright (C) 2012 Marc-Andre Cournoyer <http://macournoyer.com/>
102
+
103
+ ## SEE ALSO
104
+
105
+ thin-conf(5), [Rack spec](http://rack.rubyforge.org/doc/SPEC.html)
@@ -0,0 +1,2 @@
1
+ .sass-cache
2
+ .DS_Store
@@ -0,0 +1,21 @@
1
+ This is a static site generated by sc.
2
+
3
+ # Usage
4
+
5
+ rackup # to start dev server
6
+ rake # to compile
7
+
8
+ # Directories
9
+
10
+ +-- public static files
11
+ `-- site
12
+ |-- assets
13
+ | |-- javascripts coffee script files
14
+ | `-- stylesheets Scss files w/ compass and blueprint setup
15
+ |-- helpers.rb helper methods available insides pages & partials
16
+ |-- layouts layouts wrapping those nice pages
17
+ | |-- base.erb base layout wrapping each layout
18
+ | `-- default.erb default layout
19
+ |-- pages all pages of your site
20
+ | use extension to specify template engine (erb, haml, md, textile)
21
+ `-- partials partials you can render inside pages
@@ -0,0 +1,20 @@
1
+ require "sc"
2
+
3
+ desc "Compile the site"
4
+ task :compile do
5
+ Sc.compile
6
+ end
7
+ task :default => :compile
8
+
9
+ desc "Delete compiled files"
10
+ task :clean do
11
+ rm_rf "build"
12
+ end
13
+
14
+ desc "Deploy the site"
15
+ task :deploy => :compile do
16
+ login = "login"
17
+ address = "mysite.com"
18
+ path = "." # On remote server
19
+ sh "rsync -va build/ #{login}@#{address}:#{path}/"
20
+ end
@@ -0,0 +1,4 @@
1
+ # usage: rackup
2
+ require "sc"
3
+
4
+ run Rack::Cascade.new([Rack::File.new("public"), Sc])
@@ -0,0 +1,13 @@
1
+ /**
2
+ * DD_belatedPNG: Adds IE6 support: PNG images for CSS background-image and HTML <IMG/>.
3
+ * Author: Drew Diller
4
+ * Email: drew.diller@gmail.com
5
+ * URL: http://www.dillerdesign.com/experiment/DD_belatedPNG/
6
+ * Version: 0.0.8a
7
+ * Licensed under the MIT License: http://dillerdesign.com/experiment/DD_belatedPNG/#license
8
+ *
9
+ * Example usage:
10
+ * DD_belatedPNG.fix('.png_bg'); // argument is a CSS selector
11
+ * DD_belatedPNG.fixPng( someNode ); // argument is an HTMLDomElement
12
+ **/
13
+ var DD_belatedPNG={ns:"DD_belatedPNG",imgSize:{},delay:10,nodesFixed:0,createVmlNameSpace:function(){if(document.namespaces&&!document.namespaces[this.ns]){document.namespaces.add(this.ns,"urn:schemas-microsoft-com:vml")}},createVmlStyleSheet:function(){var b,a;b=document.createElement("style");b.setAttribute("media","screen");document.documentElement.firstChild.insertBefore(b,document.documentElement.firstChild.firstChild);if(b.styleSheet){b=b.styleSheet;b.addRule(this.ns+"\\:*","{behavior:url(#default#VML)}");b.addRule(this.ns+"\\:shape","position:absolute;");b.addRule("img."+this.ns+"_sizeFinder","behavior:none; border:none; position:absolute; z-index:-1; top:-10000px; visibility:hidden;");this.screenStyleSheet=b;a=document.createElement("style");a.setAttribute("media","print");document.documentElement.firstChild.insertBefore(a,document.documentElement.firstChild.firstChild);a=a.styleSheet;a.addRule(this.ns+"\\:*","{display: none !important;}");a.addRule("img."+this.ns+"_sizeFinder","{display: none !important;}")}},readPropertyChange:function(){var b,c,a;b=event.srcElement;if(!b.vmlInitiated){return}if(event.propertyName.search("background")!=-1||event.propertyName.search("border")!=-1){DD_belatedPNG.applyVML(b)}if(event.propertyName=="style.display"){c=(b.currentStyle.display=="none")?"none":"block";for(a in b.vml){if(b.vml.hasOwnProperty(a)){b.vml[a].shape.style.display=c}}}if(event.propertyName.search("filter")!=-1){DD_belatedPNG.vmlOpacity(b)}},vmlOpacity:function(b){if(b.currentStyle.filter.search("lpha")!=-1){var a=b.currentStyle.filter;a=parseInt(a.substring(a.lastIndexOf("=")+1,a.lastIndexOf(")")),10)/100;b.vml.color.shape.style.filter=b.currentStyle.filter;b.vml.image.fill.opacity=a}},handlePseudoHover:function(a){setTimeout(function(){DD_belatedPNG.applyVML(a)},1)},fix:function(a){if(this.screenStyleSheet){var c,b;c=a.split(",");for(b=0;b<c.length;b++){this.screenStyleSheet.addRule(c[b],"behavior:expression(DD_belatedPNG.fixPng(this))")}}},applyVML:function(a){a.runtimeStyle.cssText="";this.vmlFill(a);this.vmlOffsets(a);this.vmlOpacity(a);if(a.isImg){this.copyImageBorders(a)}},attachHandlers:function(i){var d,c,g,e,b,f;d=this;c={resize:"vmlOffsets",move:"vmlOffsets"};if(i.nodeName=="A"){e={mouseleave:"handlePseudoHover",mouseenter:"handlePseudoHover",focus:"handlePseudoHover",blur:"handlePseudoHover"};for(b in e){if(e.hasOwnProperty(b)){c[b]=e[b]}}}for(f in c){if(c.hasOwnProperty(f)){g=function(){d[c[f]](i)};i.attachEvent("on"+f,g)}}i.attachEvent("onpropertychange",this.readPropertyChange)},giveLayout:function(a){a.style.zoom=1;if(a.currentStyle.position=="static"){a.style.position="relative"}},copyImageBorders:function(b){var c,a;c={borderStyle:true,borderWidth:true,borderColor:true};for(a in c){if(c.hasOwnProperty(a)){b.vml.color.shape.style[a]=b.currentStyle[a]}}},vmlFill:function(e){if(!e.currentStyle){return}else{var d,f,g,b,a,c;d=e.currentStyle}for(b in e.vml){if(e.vml.hasOwnProperty(b)){e.vml[b].shape.style.zIndex=d.zIndex}}e.runtimeStyle.backgroundColor="";e.runtimeStyle.backgroundImage="";f=true;if(d.backgroundImage!="none"||e.isImg){if(!e.isImg){e.vmlBg=d.backgroundImage;e.vmlBg=e.vmlBg.substr(5,e.vmlBg.lastIndexOf('")')-5)}else{e.vmlBg=e.src}g=this;if(!g.imgSize[e.vmlBg]){a=document.createElement("img");g.imgSize[e.vmlBg]=a;a.className=g.ns+"_sizeFinder";a.runtimeStyle.cssText="behavior:none; position:absolute; left:-10000px; top:-10000px; border:none; margin:0; padding:0;";c=function(){this.width=this.offsetWidth;this.height=this.offsetHeight;g.vmlOffsets(e)};a.attachEvent("onload",c);a.src=e.vmlBg;a.removeAttribute("width");a.removeAttribute("height");document.body.insertBefore(a,document.body.firstChild)}e.vml.image.fill.src=e.vmlBg;f=false}e.vml.image.fill.on=!f;e.vml.image.fill.color="none";e.vml.color.shape.style.backgroundColor=d.backgroundColor;e.runtimeStyle.backgroundImage="none";e.runtimeStyle.backgroundColor="transparent"},vmlOffsets:function(d){var h,n,a,e,g,m,f,l,j,i,k;h=d.currentStyle;n={W:d.clientWidth+1,H:d.clientHeight+1,w:this.imgSize[d.vmlBg].width,h:this.imgSize[d.vmlBg].height,L:d.offsetLeft,T:d.offsetTop,bLW:d.clientLeft,bTW:d.clientTop};a=(n.L+n.bLW==1)?1:0;e=function(b,p,q,c,s,u){b.coordsize=c+","+s;b.coordorigin=u+","+u;b.path="m0,0l"+c+",0l"+c+","+s+"l0,"+s+" xe";b.style.width=c+"px";b.style.height=s+"px";b.style.left=p+"px";b.style.top=q+"px"};e(d.vml.color.shape,(n.L+(d.isImg?0:n.bLW)),(n.T+(d.isImg?0:n.bTW)),(n.W-1),(n.H-1),0);e(d.vml.image.shape,(n.L+n.bLW),(n.T+n.bTW),(n.W),(n.H),1);g={X:0,Y:0};if(d.isImg){g.X=parseInt(h.paddingLeft,10)+1;g.Y=parseInt(h.paddingTop,10)+1}else{for(j in g){if(g.hasOwnProperty(j)){this.figurePercentage(g,n,j,h["backgroundPosition"+j])}}}d.vml.image.fill.position=(g.X/n.W)+","+(g.Y/n.H);m=h.backgroundRepeat;f={T:1,R:n.W+a,B:n.H,L:1+a};l={X:{b1:"L",b2:"R",d:"W"},Y:{b1:"T",b2:"B",d:"H"}};if(m!="repeat"||d.isImg){i={T:(g.Y),R:(g.X+n.w),B:(g.Y+n.h),L:(g.X)};if(m.search("repeat-")!=-1){k=m.split("repeat-")[1].toUpperCase();i[l[k].b1]=1;i[l[k].b2]=n[l[k].d]}if(i.B>n.H){i.B=n.H}d.vml.image.shape.style.clip="rect("+i.T+"px "+(i.R+a)+"px "+i.B+"px "+(i.L+a)+"px)"}else{d.vml.image.shape.style.clip="rect("+f.T+"px "+f.R+"px "+f.B+"px "+f.L+"px)"}},figurePercentage:function(d,c,f,a){var b,e;e=true;b=(f=="X");switch(a){case"left":case"top":d[f]=0;break;case"center":d[f]=0.5;break;case"right":case"bottom":d[f]=1;break;default:if(a.search("%")!=-1){d[f]=parseInt(a,10)/100}else{e=false}}d[f]=Math.ceil(e?((c[b?"W":"H"]*d[f])-(c[b?"w":"h"]*d[f])):parseInt(a,10));if(d[f]%2===0){d[f]++}return d[f]},fixPng:function(c){c.style.behavior="none";var g,b,f,a,d;if(c.nodeName=="BODY"||c.nodeName=="TD"||c.nodeName=="TR"){return}c.isImg=false;if(c.nodeName=="IMG"){if(c.src.toLowerCase().search(/\.png$/)!=-1){c.isImg=true;c.style.visibility="hidden"}else{return}}else{if(c.currentStyle.backgroundImage.toLowerCase().search(".png")==-1){return}}g=DD_belatedPNG;c.vml={color:{},image:{}};b={shape:{},fill:{}};for(a in c.vml){if(c.vml.hasOwnProperty(a)){for(d in b){if(b.hasOwnProperty(d)){f=g.ns+":"+d;c.vml[a][d]=document.createElement(f)}}c.vml[a].shape.stroked=false;c.vml[a].shape.appendChild(c.vml[a].fill);c.parentNode.insertBefore(c.vml[a].shape,c)}}c.vml.image.shape.fillcolor="none";c.vml.image.fill.type="tile";c.vml.color.fill.on=false;g.attachHandlers(c);g.giveLayout(c);g.giveLayout(c.offsetParent);c.vmlInitiated=true;g.applyVML(c)}};try{document.execCommand("BackgroundImageCache",false,true)}catch(r){}DD_belatedPNG.createVmlNameSpace();DD_belatedPNG.createVmlStyleSheet();
@@ -0,0 +1,30 @@
1
+ /*
2
+ * Modernizr v1.6
3
+ * http://www.modernizr.com
4
+ *
5
+ * Developed by:
6
+ * - Faruk Ates http://farukat.es/
7
+ * - Paul Irish http://paulirish.com/
8
+ *
9
+ * Copyright (c) 2009-2010
10
+ * Dual-licensed under the BSD or MIT licenses.
11
+ * http://www.modernizr.com/license/
12
+ */
13
+ window.Modernizr=function(i,e,u){function s(a,b){return(""+a).indexOf(b)!==-1}function D(a,b){for(var c in a)if(j[a[c]]!==u&&(!b||b(a[c],E)))return true}function n(a,b){var c=a.charAt(0).toUpperCase()+a.substr(1);c=(a+" "+F.join(c+" ")+c).split(" ");return!!D(c,b)}function S(){f.input=function(a){for(var b=0,c=a.length;b<c;b++)L[a[b]]=!!(a[b]in h);return L}("autocomplete autofocus list placeholder max min multiple pattern required step".split(" "));f.inputtypes=function(a){for(var b=0,c,k=a.length;b<
14
+ k;b++){h.setAttribute("type",a[b]);if(c=h.type!=="text"){h.value=M;if(/^range$/.test(h.type)&&h.style.WebkitAppearance!==u){l.appendChild(h);c=e.defaultView;c=c.getComputedStyle&&c.getComputedStyle(h,null).WebkitAppearance!=="textfield"&&h.offsetHeight!==0;l.removeChild(h)}else/^(search|tel)$/.test(h.type)||(c=/^(url|email)$/.test(h.type)?h.checkValidity&&h.checkValidity()===false:h.value!=M)}N[a[b]]=!!c}return N}("search tel url email datetime date month week time datetime-local number range color".split(" "))}
15
+ var f={},l=e.documentElement,E=e.createElement("modernizr"),j=E.style,h=e.createElement("input"),M=":)",O=Object.prototype.toString,q=" -webkit- -moz- -o- -ms- -khtml- ".split(" "),F="Webkit Moz O ms Khtml".split(" "),v={svg:"http://www.w3.org/2000/svg"},d={},N={},L={},P=[],w,Q=function(a){var b=document.createElement("style"),c=e.createElement("div");b.textContent=a+"{#modernizr{height:3px}}";(e.head||e.getElementsByTagName("head")[0]).appendChild(b);c.id="modernizr";l.appendChild(c);a=c.offsetHeight===
16
+ 3;b.parentNode.removeChild(b);c.parentNode.removeChild(c);return!!a},o=function(){var a={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};return function(b,c){c=c||document.createElement(a[b]||"div");b="on"+b;var k=b in c;if(!k){c.setAttribute||(c=document.createElement("div"));if(c.setAttribute&&c.removeAttribute){c.setAttribute(b,"");k=typeof c[b]=="function";if(typeof c[b]!="undefined")c[b]=u;c.removeAttribute(b)}}return k}}(),G={}.hasOwnProperty,R;R=
17
+ typeof G!=="undefined"&&typeof G.call!=="undefined"?function(a,b){return G.call(a,b)}:function(a,b){return b in a&&typeof a.constructor.prototype[b]==="undefined"};d.flexbox=function(){var a=e.createElement("div"),b=e.createElement("div");(function(k,g,r,x){g+=":";k.style.cssText=(g+q.join(r+";"+g)).slice(0,-g.length)+(x||"")})(a,"display","box","width:42px;padding:0;");b.style.cssText=q.join("box-flex:1;")+"width:10px;";a.appendChild(b);l.appendChild(a);var c=b.offsetWidth===42;a.removeChild(b);
18
+ l.removeChild(a);return c};d.canvas=function(){var a=e.createElement("canvas");return!!(a.getContext&&a.getContext("2d"))};d.canvastext=function(){return!!(f.canvas&&typeof e.createElement("canvas").getContext("2d").fillText=="function")};d.webgl=function(){var a=e.createElement("canvas");try{if(a.getContext("webgl"))return true}catch(b){}try{if(a.getContext("experimental-webgl"))return true}catch(c){}return false};d.touch=function(){return"ontouchstart"in i||Q("@media ("+q.join("touch-enabled),(")+
19
+ "modernizr)")};d.geolocation=function(){return!!navigator.geolocation};d.postmessage=function(){return!!i.postMessage};d.websqldatabase=function(){return!!i.openDatabase};d.indexedDB=function(){for(var a=-1,b=F.length;++a<b;){var c=F[a].toLowerCase();if(i[c+"_indexedDB"]||i[c+"IndexedDB"])return true}return false};d.hashchange=function(){return o("hashchange",i)&&(document.documentMode===u||document.documentMode>7)};d.history=function(){return!!(i.history&&history.pushState)};d.draganddrop=function(){return o("drag")&&
20
+ o("dragstart")&&o("dragenter")&&o("dragover")&&o("dragleave")&&o("dragend")&&o("drop")};d.websockets=function(){return"WebSocket"in i};d.rgba=function(){j.cssText="background-color:rgba(150,255,150,.5)";return s(j.backgroundColor,"rgba")};d.hsla=function(){j.cssText="background-color:hsla(120,40%,100%,.5)";return s(j.backgroundColor,"rgba")||s(j.backgroundColor,"hsla")};d.multiplebgs=function(){j.cssText="background:url(//:),url(//:),red url(//:)";return/(url\s*\(.*?){3}/.test(j.background)};d.backgroundsize=
21
+ function(){return n("backgroundSize")};d.borderimage=function(){return n("borderImage")};d.borderradius=function(){return n("borderRadius","",function(a){return s(a,"orderRadius")})};d.boxshadow=function(){return n("boxShadow")};d.textshadow=function(){return e.createElement("div").style.textShadow===""};d.opacity=function(){var a=q.join("opacity:.5;")+"";j.cssText=a;return s(j.opacity,"0.5")};d.cssanimations=function(){return n("animationName")};d.csscolumns=function(){return n("columnCount")};d.cssgradients=
22
+ function(){var a=("background-image:"+q.join("gradient(linear,left top,right bottom,from(#9f9),to(white));background-image:")+q.join("linear-gradient(left top,#9f9, white);background-image:")).slice(0,-17);j.cssText=a;return s(j.backgroundImage,"gradient")};d.cssreflections=function(){return n("boxReflect")};d.csstransforms=function(){return!!D(["transformProperty","WebkitTransform","MozTransform","OTransform","msTransform"])};d.csstransforms3d=function(){var a=!!D(["perspectiveProperty","WebkitPerspective",
23
+ "MozPerspective","OPerspective","msPerspective"]);if(a)a=Q("@media ("+q.join("transform-3d),(")+"modernizr)");return a};d.csstransitions=function(){return n("transitionProperty")};d.fontface=function(){var a,b=e.head||e.getElementsByTagName("head")[0]||l,c=e.createElement("style"),k=e.implementation||{hasFeature:function(){return false}};c.type="text/css";b.insertBefore(c,b.firstChild);a=c.sheet||c.styleSheet;b=k.hasFeature("CSS2","")?function(g){if(!(a&&g))return false;var r=false;try{a.insertRule(g,
24
+ 0);r=!/unknown/i.test(a.cssRules[0].cssText);a.deleteRule(a.cssRules.length-1)}catch(x){}return r}:function(g){if(!(a&&g))return false;a.cssText=g;return a.cssText.length!==0&&!/unknown/i.test(a.cssText)&&a.cssText.replace(/\r+|\n+/g,"").indexOf(g.split(" ")[0])===0};f._fontfaceready=function(g){g(f.fontface)};return b('@font-face { font-family: "font"; src: "font.ttf"; }')};d.video=function(){var a=e.createElement("video"),b=!!a.canPlayType;if(b){b=new Boolean(b);b.ogg=a.canPlayType('video/ogg; codecs="theora"');
25
+ b.h264=a.canPlayType('video/mp4; codecs="avc1.42E01E"')||a.canPlayType('video/mp4; codecs="avc1.42E01E, mp4a.40.2"');b.webm=a.canPlayType('video/webm; codecs="vp8, vorbis"')}return b};d.audio=function(){var a=e.createElement("audio"),b=!!a.canPlayType;if(b){b=new Boolean(b);b.ogg=a.canPlayType('audio/ogg; codecs="vorbis"');b.mp3=a.canPlayType("audio/mpeg;");b.wav=a.canPlayType('audio/wav; codecs="1"');b.m4a=a.canPlayType("audio/x-m4a;")||a.canPlayType("audio/aac;")}return b};d.localstorage=function(){try{return"localStorage"in
26
+ i&&i.localStorage!==null}catch(a){return false}};d.sessionstorage=function(){try{return"sessionStorage"in i&&i.sessionStorage!==null}catch(a){return false}};d.webWorkers=function(){return!!i.Worker};d.applicationcache=function(){return!!i.applicationCache};d.svg=function(){return!!e.createElementNS&&!!e.createElementNS(v.svg,"svg").createSVGRect};d.inlinesvg=function(){var a=document.createElement("div");a.innerHTML="<svg/>";return(a.firstChild&&a.firstChild.namespaceURI)==v.svg};d.smil=function(){return!!e.createElementNS&&
27
+ /SVG/.test(O.call(e.createElementNS(v.svg,"animate")))};d.svgclippaths=function(){return!!e.createElementNS&&/SVG/.test(O.call(e.createElementNS(v.svg,"clipPath")))};for(var H in d)if(R(d,H)){w=H.toLowerCase();f[w]=d[H]();P.push((f[w]?"":"no-")+w)}f.input||S();f.crosswindowmessaging=f.postmessage;f.historymanagement=f.history;f.addTest=function(a,b){a=a.toLowerCase();if(!f[a]){b=!!b();l.className+=" "+(b?"":"no-")+a;f[a]=b;return f}};j.cssText="";E=h=null;i.attachEvent&&function(){var a=e.createElement("div");
28
+ a.innerHTML="<elem></elem>";return a.childNodes.length!==1}()&&function(a,b){function c(p){for(var m=-1;++m<r;)p.createElement(g[m])}function k(p,m){for(var I=p.length,t=-1,y,J=[];++t<I;){y=p[t];m=y.media||m;J.push(k(y.imports,m));J.push(y.cssText)}return J.join("")}var g="abbr|article|aside|audio|canvas|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video".split("|"),r=g.length,x=RegExp("<(/*)(abbr|article|aside|audio|canvas|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video)",
29
+ "gi"),T=RegExp("\\b(abbr|article|aside|audio|canvas|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video)\\b(?!.*[;}])","gi"),z=b.createDocumentFragment(),A=b.documentElement,K=A.firstChild,B=b.createElement("style"),C=b.createElement("body");B.media="all";c(b);c(z);a.attachEvent("onbeforeprint",function(){for(var p=-1;++p<r;)for(var m=b.getElementsByTagName(g[p]),I=m.length,t=-1;++t<I;)if(m[t].className.indexOf("iepp_")<0)m[t].className+=" iepp_"+
30
+ g[p];K.insertBefore(B,K.firstChild);B.styleSheet.cssText=k(b.styleSheets,"all").replace(T,".iepp_$1");z.appendChild(b.body);A.appendChild(C);C.innerHTML=z.firstChild.innerHTML.replace(x,"<$1bdo")});a.attachEvent("onafterprint",function(){C.innerHTML="";A.removeChild(C);K.removeChild(B);A.appendChild(z.firstChild)})}(this,document);f._enableHTML5=true;f._version="1.6";l.className=l.className.replace(/\bno-js\b/,"")+" js";l.className+=" "+P.join(" ");return f}(this,this.document);
@@ -0,0 +1,220 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta http-equiv='content-type' value='text/html;charset=utf8'>
5
+ <meta name='generator' value='Ronn/v0.7.3 (http://github.com/rtomayko/ronn/tree/0.7.3)'>
6
+ <title>thin-conf(5) - Configuration file for the Thin Ruby server</title>
7
+ <style type='text/css' media='all'>
8
+ /* style: man */
9
+ body#manpage {margin:0}
10
+ .mp {max-width:100ex;padding:0 9ex 1ex 4ex}
11
+ .mp p,.mp pre,.mp ul,.mp ol,.mp dl {margin:0 0 20px 0}
12
+ .mp h2 {margin:10px 0 0 0}
13
+ .mp > p,.mp > pre,.mp > ul,.mp > ol,.mp > dl {margin-left:8ex}
14
+ .mp h3 {margin:0 0 0 4ex}
15
+ .mp dt {margin:0;clear:left}
16
+ .mp dt.flush {float:left;width:8ex}
17
+ .mp dd {margin:0 0 0 9ex}
18
+ .mp h1,.mp h2,.mp h3,.mp h4 {clear:left}
19
+ .mp pre {margin-bottom:20px}
20
+ .mp pre+h2,.mp pre+h3 {margin-top:22px}
21
+ .mp h2+pre,.mp h3+pre {margin-top:5px}
22
+ .mp img {display:block;margin:auto}
23
+ .mp h1.man-title {display:none}
24
+ .mp,.mp code,.mp pre,.mp tt,.mp kbd,.mp samp,.mp h3,.mp h4 {font-family:monospace;font-size:14px;line-height:1.42857142857143}
25
+ .mp h2 {font-size:16px;line-height:1.25}
26
+ .mp h1 {font-size:20px;line-height:2}
27
+ .mp {text-align:justify;background:#fff}
28
+ .mp,.mp code,.mp pre,.mp pre code,.mp tt,.mp kbd,.mp samp {color:#131211}
29
+ .mp h1,.mp h2,.mp h3,.mp h4 {color:#030201}
30
+ .mp u {text-decoration:underline}
31
+ .mp code,.mp strong,.mp b {font-weight:bold;color:#131211}
32
+ .mp em,.mp var {font-style:italic;color:#232221;text-decoration:none}
33
+ .mp a,.mp a:link,.mp a:hover,.mp a code,.mp a pre,.mp a tt,.mp a kbd,.mp a samp {color:#0000ff}
34
+ .mp b.man-ref {font-weight:normal;color:#434241}
35
+ .mp pre {padding:0 4ex}
36
+ .mp pre code {font-weight:normal;color:#434241}
37
+ .mp h2+pre,h3+pre {padding-left:0}
38
+ ol.man-decor,ol.man-decor li {margin:3px 0 10px 0;padding:0;float:left;width:33%;list-style-type:none;text-transform:uppercase;color:#999;letter-spacing:1px}
39
+ ol.man-decor {width:100%}
40
+ ol.man-decor li.tl {text-align:left}
41
+ ol.man-decor li.tc {text-align:center;letter-spacing:4px}
42
+ ol.man-decor li.tr {text-align:right;float:right}
43
+ </style>
44
+ <style type='text/css' media='all'>
45
+ /* style: toc */
46
+ .man-navigation {display:block !important;position:fixed;top:0;left:113ex;height:100%;width:100%;padding:48px 0 0 0;border-left:1px solid #dbdbdb;background:#eee}
47
+ .man-navigation a,.man-navigation a:hover,.man-navigation a:link,.man-navigation a:visited {display:block;margin:0;padding:5px 2px 5px 30px;color:#999;text-decoration:none}
48
+ .man-navigation a:hover {color:#111;text-decoration:underline}
49
+ </style>
50
+ </head>
51
+ <!--
52
+ The following styles are deprecated and will be removed at some point:
53
+ div#man, div#man ol.man, div#man ol.head, div#man ol.man.
54
+
55
+ The .man-page, .man-decor, .man-head, .man-foot, .man-title, and
56
+ .man-navigation should be used instead.
57
+ -->
58
+ <body id='manpage'>
59
+ <div class='mp' id='man'>
60
+
61
+ <div class='man-navigation' style='display:none'>
62
+ <a href="#NAME">NAME</a>
63
+ <a href="#SYNOPSIS">SYNOPSIS</a>
64
+ <a href="#SYNTAX">SYNTAX</a>
65
+ <a href="#WORKER-PROCESSES-worker_processes-">WORKER PROCESSES (#worker_processes)</a>
66
+ <a href="#WORKER-CONNECTIONS-worker_connections-">WORKER CONNECTIONS (#worker_connections)</a>
67
+ <a href="#LISTEN-listen-">LISTEN (#listen)</a>
68
+ <a href="#PRELOAD-APP-preload_app-">PRELOAD APP (#preload_app)</a>
69
+ <a href="#TIMEOUT-timeout-">TIMEOUT (#timeout)</a>
70
+ <a href="#KEEP-ALIVE-REQUESTS-keep_alive_requests-">KEEP-ALIVE REQUESTS (#keep_alive_requests)</a>
71
+ <a href="#THREADED-MODE-threaded-thread_pool_size-">THREADED MODE (#threaded, #thread_pool_size)</a>
72
+ <a href="#LOG-PATH-log_path-">LOG PATH (#log_path)</a>
73
+ <a href="#PID-PATH-pid_path-">PID PATH (#pid_path)</a>
74
+ <a href="#EVENT-MODEL-use_epoll-use_kqueue-">EVENT MODEL (#use_epoll, #use_kqueue)</a>
75
+ <a href="#CALLBACKS-before_fork-after_fork-">CALLBACKS (#before_fork, #after_fork)</a>
76
+ </div>
77
+
78
+ <ol class='man-decor man-head man head'>
79
+ <li class='tl'>thin-conf(5)</li>
80
+ <li class='tc'>Thin Manual</li>
81
+ <li class='tr'>thin-conf(5)</li>
82
+ </ol>
83
+
84
+ <h2 id="NAME">NAME</h2>
85
+ <p class="man-name">
86
+ <code>thin-conf</code> - <span class="man-whatis">Configuration file for the Thin Ruby server</span>
87
+ </p>
88
+
89
+ <h2 id="SYNOPSIS">SYNOPSIS</h2>
90
+
91
+ <p>A file used to configure a Thin server. This file is to be passed to the <code>-c</code> option of <a class="man-ref" href="thin.1.html">thin<span class="s">(1)</span></a>.</p>
92
+
93
+ <h2 id="SYNTAX">SYNTAX</h2>
94
+
95
+ <p>A Thin configuration file is evaluated as Ruby code, in a context which makes available
96
+ a number of methods used to configure the server.</p>
97
+
98
+ <h2 id="WORKER-PROCESSES-worker_processes-">WORKER PROCESSES (#worker_processes)</h2>
99
+
100
+ <p>Number of child worker processes.
101
+ Setting this to 0 will result in running in a single process with limited features.</p>
102
+
103
+ <pre><code>worker_processes 4
104
+ </code></pre>
105
+
106
+ <p>Default: number of processors available or 0 if <span class="man-ref">fork<span class="s">(2)</span></span> is not available.</p>
107
+
108
+ <h2 id="WORKER-CONNECTIONS-worker_connections-">WORKER CONNECTIONS (#worker_connections)</h2>
109
+
110
+ <p>Maximum number of file descriptors that a worker may open. This includes socket and file descriptors.</p>
111
+
112
+ <pre><code>worker_connections 1024
113
+ </code></pre>
114
+
115
+ <p>Default: 1024.</p>
116
+
117
+ <h2 id="LISTEN-listen-">LISTEN (#listen)</h2>
118
+
119
+ <p>Listen for incoming connections on a given address.</p>
120
+
121
+ <pre><code>listen 3000
122
+ listen "0.0.0.0:8008", :backlog =&gt; 80
123
+
124
+ # IPv6 address
125
+ listen "[::]:8008", :ipv6_only =&gt; true
126
+
127
+ # Unix domain sockets
128
+ listen "/tmp/thin.sock"
129
+ </code></pre>
130
+
131
+ <h3 id="OPTIONS">OPTIONS</h3>
132
+
133
+ <dl>
134
+ <dt><code>tcp_no_delay</code></dt><dd><p>Disables the Nagle algorithm for send coalescing. Default: <code>true</code>.</p></dd>
135
+ <dt><code>tcp_no_push</code></dt><dd><p>Allows the use of the socket options TCP_NOPUSH on FreeBSD or TCP_CORK on Linux.
136
+ Setting this option causes Thin to attempt to send it's HTTP response headers in one packet on Linux and FreeBSD 4.x. Default: <code>false</code>.</p></dd>
137
+ <dt><code>ipv6_only</code></dt><dd><p>Do not listen on IPv4 interface. Default: <code>false</code>.</p></dd>
138
+ <dt class="flush"><code>backlog</code></dt><dd><p>Maximum number of clients in the listening backlog. Default: <code>1024</code></p></dd>
139
+ </dl>
140
+
141
+
142
+ <h2 id="PRELOAD-APP-preload_app-">PRELOAD APP (#preload_app)</h2>
143
+
144
+ <p>Set to <code>true</code> to load the app before forking to workers. Default: <code>false</code>. If the Ruby interpreter garbage collector doesn't support copy on write, set this option to false which will prevent loading your application in the master process. If the interpreter does support copy on write, setting this to <code>true</code> will help save memory.</p>
145
+
146
+ <p>Default: <code>false</code>.</p>
147
+
148
+ <h2 id="TIMEOUT-timeout-">TIMEOUT (#timeout)</h2>
149
+
150
+ <p>Number of seconds before an inactive connection is closed.
151
+ Workers are also killed if they don't check-in under this amount of seconds.</p>
152
+
153
+ <h2 id="KEEP-ALIVE-REQUESTS-keep_alive_requests-">KEEP-ALIVE REQUESTS (#keep_alive_requests)</h2>
154
+
155
+ <p>Maximum number of concurrent requests which can be made over a keep-alive connection.</p>
156
+
157
+ <p>Default: <code>100</code>.</p>
158
+
159
+ <h2 id="THREADED-MODE-threaded-thread_pool_size-">THREADED MODE (#threaded, #thread_pool_size)</h2>
160
+
161
+ <p>Use threads to process the requests. The Rack app will be called inside a thread. Threads are pooled, you can control the minimum size of that pool using the <code>thread_pool_size</code> option.</p>
162
+
163
+ <pre><code>threaded true
164
+ thread_pool_size 20
165
+ </code></pre>
166
+
167
+ <p>Defaults: threaded: <code>false</code>, thread_pool_size: <code>20</code>.</p>
168
+
169
+ <h2 id="LOG-PATH-log_path-">LOG PATH (#log_path)</h2>
170
+
171
+ <p>Path to the file in which standard output streams are redirected.</p>
172
+
173
+ <pre><code>log_path "my_app.log"
174
+ </code></pre>
175
+
176
+ <p>By default standard output streams are not redirected.</p>
177
+
178
+ <h2 id="PID-PATH-pid_path-">PID PATH (#pid_path)</h2>
179
+
180
+ <p>Path to the file in which the PID is saved.</p>
181
+
182
+ <pre><code>pid_path "my_app.pid"
183
+ </code></pre>
184
+
185
+ <p>Default: <code>./thin.pid</code>.</p>
186
+
187
+ <h2 id="EVENT-MODEL-use_epoll-use_kqueue-">EVENT MODEL (#use_epoll, #use_kqueue)</h2>
188
+
189
+ <p>Force or disable an event model in EventMachine.</p>
190
+
191
+ <pre><code>use_epoll false
192
+ </code></pre>
193
+
194
+ <p>Epoll is used under Linux systems and Kqueue is used mainly under Mac OS X. Disabling will result in using <span class="man-ref">select<span class="s">(2)</span></span>.</p>
195
+
196
+ <h2 id="CALLBACKS-before_fork-after_fork-">CALLBACKS (#before_fork, #after_fork)</h2>
197
+
198
+ <p>Blocks of Ruby code executed before or after forking a worker process. <code>before_fork</code> will be called inside the master process and <code>after_fork</code> will be called inside a worker process.</p>
199
+
200
+ <pre><code>before_fork do |server|
201
+ # ...
202
+ end
203
+
204
+ before_fork do |server, worker|
205
+ # ...
206
+ end
207
+ </code></pre>
208
+
209
+ <p>The <code>server</code> argument is an instance of <code>Thin::Server</code> from which you get access to all the configuration. <code>worker</code> has <code>kill</code> method to exist gracefully.</p>
210
+
211
+
212
+ <ol class='man-decor man-foot man foot'>
213
+ <li class='tl'>Thin 2.0.0.pre</li>
214
+ <li class='tc'>August 2012</li>
215
+ <li class='tr'>thin-conf(5)</li>
216
+ </ol>
217
+
218
+ </div>
219
+ </body>
220
+ </html>