unicorn 5.4.0 → 5.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. checksums.yaml +4 -4
  2. data/.manifest +7 -3
  3. data/.olddoc.yml +12 -7
  4. data/Application_Timeouts +4 -4
  5. data/Documentation/.gitignore +1 -3
  6. data/Documentation/unicorn.1 +222 -0
  7. data/Documentation/unicorn_rails.1 +207 -0
  8. data/FAQ +1 -1
  9. data/GIT-VERSION-FILE +1 -1
  10. data/GIT-VERSION-GEN +1 -1
  11. data/GNUmakefile +16 -6
  12. data/HACKING +1 -1
  13. data/ISSUES +17 -22
  14. data/KNOWN_ISSUES +2 -2
  15. data/LATEST +18 -8
  16. data/LICENSE +2 -2
  17. data/Links +13 -11
  18. data/NEWS +94 -0
  19. data/README +18 -11
  20. data/SIGNALS +1 -1
  21. data/Sandbox +4 -4
  22. data/archive/slrnpull.conf +1 -1
  23. data/bin/unicorn +3 -1
  24. data/bin/unicorn_rails +2 -2
  25. data/examples/big_app_gc.rb +1 -1
  26. data/examples/logrotate.conf +3 -3
  27. data/examples/nginx.conf +4 -3
  28. data/examples/unicorn.conf.minimal.rb +2 -2
  29. data/examples/unicorn.conf.rb +2 -2
  30. data/examples/unicorn@.service +7 -0
  31. data/ext/unicorn_http/common_field_optimization.h +24 -6
  32. data/ext/unicorn_http/extconf.rb +30 -0
  33. data/ext/unicorn_http/global_variables.h +2 -2
  34. data/ext/unicorn_http/httpdate.c +2 -2
  35. data/ext/unicorn_http/unicorn_http.c +257 -224
  36. data/ext/unicorn_http/unicorn_http.rl +47 -14
  37. data/lib/unicorn/configurator.rb +25 -4
  38. data/lib/unicorn/http_request.rb +12 -2
  39. data/lib/unicorn/http_server.rb +50 -23
  40. data/lib/unicorn/launcher.rb +1 -1
  41. data/lib/unicorn/oob_gc.rb +2 -2
  42. data/lib/unicorn/socket_helper.rb +3 -2
  43. data/lib/unicorn/tmpio.rb +8 -2
  44. data/lib/unicorn/util.rb +3 -3
  45. data/lib/unicorn/version.rb +1 -1
  46. data/lib/unicorn/worker.rb +16 -2
  47. data/lib/unicorn.rb +23 -9
  48. data/man/man1/unicorn.1 +88 -85
  49. data/man/man1/unicorn_rails.1 +79 -81
  50. data/t/README +4 -4
  51. data/t/t0301-no-default-middleware-ignored-in-config.sh +25 -0
  52. data/t/t0301.ru +13 -0
  53. data/test/benchmark/README +14 -4
  54. data/test/benchmark/ddstream.ru +50 -0
  55. data/test/benchmark/readinput.ru +40 -0
  56. data/test/benchmark/uconnect.perl +66 -0
  57. data/test/exec/test_exec.rb +15 -14
  58. data/test/test_helper.rb +0 -26
  59. data/test/unit/test_ccc.rb +1 -1
  60. data/test/unit/test_http_parser.rb +16 -0
  61. data/test/unit/test_http_parser_ng.rb +81 -0
  62. data/test/unit/test_server.rb +35 -5
  63. data/test/unit/test_signals.rb +2 -2
  64. data/test/unit/test_socket_helper.rb +4 -4
  65. data/test/unit/test_upload.rb +4 -9
  66. data/test/unit/test_util.rb +25 -0
  67. data/unicorn.gemspec +3 -3
  68. metadata +13 -9
  69. data/Documentation/GNUmakefile +0 -30
  70. data/Documentation/unicorn.1.txt +0 -187
  71. data/Documentation/unicorn_rails.1.txt +0 -175
data/man/man1/unicorn.1 CHANGED
@@ -1,4 +1,5 @@
1
1
  .TH "UNICORN" "1" "September 15, 2009" "Unicorn User Manual" ""
2
+ .hy
2
3
  .SH NAME
3
4
  .PP
4
5
  unicorn \- a rackup\-like command to launch the Unicorn HTTP server
@@ -8,74 +9,73 @@ unicorn [\-c CONFIG_FILE] [\-E RACK_ENV] [\-D] [RACKUP_FILE]
8
9
  .SH DESCRIPTION
9
10
  .PP
10
11
  A rackup(1)\-like command to launch Rack applications using Unicorn.
11
- It is expected to be started in your application root (APP_ROOT), but
12
- the "working_directory" directive may be used in the CONFIG_FILE.
12
+ It is expected to be started in your application root (APP_ROOT),
13
+ but the "working_directory" directive may be used in the CONFIG_FILE.
13
14
  .PP
14
- While unicorn takes a myriad of command\-line options for compatibility
15
- with ruby(1) and rackup(1), it is recommended to stick to the few
16
- command\-line options specified in the SYNOPSIS and use the CONFIG_FILE
17
- as much as possible.
15
+ While unicorn takes a myriad of command\-line options for
16
+ compatibility with ruby(1) and rackup(1), it is recommended to stick
17
+ to the few command\-line options specified in the SYNOPSIS and use
18
+ the CONFIG_FILE as much as possible.
18
19
  .SH RACKUP FILE
19
20
  .PP
20
- This defaults to "config.ru" in APP_ROOT.
21
- It should be the same file used by rackup(1) and other Rack launchers,
22
- it uses the \f[I]Rack::Builder\f[] DSL.
21
+ This defaults to "config.ru" in APP_ROOT. It should be the same
22
+ file used by rackup(1) and other Rack launchers, it uses the
23
+ \f[I]Rack::Builder\f[] DSL.
23
24
  .PP
24
- Embedded command\-line options are mostly parsed for compatibility with
25
- rackup(1) but strongly discouraged.
25
+ Embedded command\-line options are mostly parsed for compatibility
26
+ with rackup(1) but strongly discouraged.
26
27
  .SH UNICORN OPTIONS
27
28
  .TP
28
29
  .B \-c, \-\-config\-file CONFIG_FILE
29
- Path to the Unicorn\-specific config file.
30
- The config file is implemented as a Ruby DSL, so Ruby code may executed.
31
- See the RDoc/ri for the \f[I]Unicorn::Configurator\f[] class for the
32
- full list of directives available from the DSL.
33
- Using an absolute path for for CONFIG_FILE is recommended as it makes
34
- multiple instances of Unicorn easily distinguishable when viewing ps(1)
35
- output.
30
+ Path to the Unicorn\-specific config file. The config file is
31
+ implemented as a Ruby DSL, so Ruby code may executed.
32
+ See the RDoc/ri for the \f[I]Unicorn::Configurator\f[] class for the full
33
+ list of directives available from the DSL.
34
+ Using an absolute path for for CONFIG_FILE is recommended as it
35
+ makes multiple instances of Unicorn easily distinguishable when
36
+ viewing ps(1) output.
36
37
  .RS
37
38
  .RE
38
39
  .TP
39
40
  .B \-D, \-\-daemonize
40
- Run daemonized in the background.
41
- The process is detached from the controlling terminal and stdin is
42
- redirected to "/dev/null".
43
- Unlike many common UNIX daemons, we do not chdir to "/" upon
44
- daemonization to allow more control over the startup/upgrade process.
45
- Unless specified in the CONFIG_FILE, stderr and stdout will also be
46
- redirected to "/dev/null".
41
+ Run daemonized in the background. The process is detached from
42
+ the controlling terminal and stdin is redirected to "/dev/null".
43
+ Unlike many common UNIX daemons, we do not chdir to "/"
44
+ upon daemonization to allow more control over the startup/upgrade
45
+ process.
46
+ Unless specified in the CONFIG_FILE, stderr and stdout will
47
+ also be redirected to "/dev/null".
47
48
  .RS
48
49
  .RE
49
50
  .TP
50
51
  .B \-E, \-\-env RACK_ENV
51
- Run under the given RACK_ENV.
52
- See the RACK ENVIRONMENT section for more details.
52
+ Run under the given RACK_ENV. See the RACK ENVIRONMENT section
53
+ for more details.
53
54
  .RS
54
55
  .RE
55
56
  .TP
56
57
  .B \-l, \-\-listen ADDRESS
57
- Listens on a given ADDRESS.
58
- ADDRESS may be in the form of HOST:PORT or PATH, HOST:PORT is taken to
59
- mean a TCP socket and PATH is meant to be a path to a UNIX domain
60
- socket.
61
- Defaults to "0.0.0.0:8080" (all addresses on TCP port 8080) For
62
- production deployments, specifying the "listen" directive in CONFIG_FILE
63
- is recommended as it allows fine\-tuning of socket options.
58
+ Listens on a given ADDRESS. ADDRESS may be in the form of
59
+ HOST:PORT or PATH, HOST:PORT is taken to mean a TCP socket
60
+ and PATH is meant to be a path to a UNIX domain socket.
61
+ Defaults to "0.0.0.0:8080" (all addresses on TCP port 8080)
62
+ For production deployments, specifying the "listen" directive in
63
+ CONFIG_FILE is recommended as it allows fine\-tuning of socket
64
+ options.
64
65
  .RS
65
66
  .RE
66
67
  .TP
67
68
  .B \-N, \-\-no\-default\-middleware
68
- Disables loading middleware implied by RACK_ENV.
69
- This bypasses the configuration documented in the RACK ENVIRONMENT
70
- section, but still allows RACK_ENV to be used for
71
- application/framework\-specific purposes.
69
+ Disables loading middleware implied by RACK_ENV. This bypasses the
70
+ configuration documented in the RACK ENVIRONMENT section, but still
71
+ allows RACK_ENV to be used for application/framework\-specific purposes.
72
72
  .RS
73
73
  .RE
74
74
  .SH RACKUP COMPATIBILITY OPTIONS
75
75
  .TP
76
76
  .B \-o, \-\-host HOST
77
- Listen on a TCP socket belonging to HOST, default is "0.0.0.0" (all
78
- addresses).
77
+ Listen on a TCP socket belonging to HOST, default is
78
+ "0.0.0.0" (all addresses).
79
79
  If specified multiple times on the command\-line, only the
80
80
  last\-specified value takes effect.
81
81
  This option only exists for compatibility with the rackup(1) command,
@@ -85,8 +85,8 @@ use of "\-l"/"\-\-listen" switch is recommended instead.
85
85
  .TP
86
86
  .B \-p, \-\-port PORT
87
87
  Listen on the specified TCP PORT, default is 8080.
88
- If specified multiple times on the command\-line, only the
89
- last\-specified value takes effect.
88
+ If specified multiple times on the command\-line, only the last\-specified
89
+ value takes effect.
90
90
  This option only exists for compatibility with the rackup(1) command,
91
91
  use of "\-l"/"\-\-listen" switch is recommended instead.
92
92
  .RS
@@ -99,9 +99,8 @@ No\-op, this exists only for compatibility with rackup(1).
99
99
  .SH RUBY OPTIONS
100
100
  .TP
101
101
  .B \-e, \-\-eval LINE
102
- Evaluate a LINE of Ruby code.
103
- This evaluation happens immediately as the command\-line is being
104
- parsed.
102
+ Evaluate a LINE of Ruby code. This evaluation happens
103
+ immediately as the command\-line is being parsed.
105
104
  .RS
106
105
  .RE
107
106
  .TP
@@ -116,18 +115,17 @@ Turn on verbose warnings, the $VERBOSE variable is set to true.
116
115
  .RE
117
116
  .TP
118
117
  .B \-I, \-\-include PATH
119
- specify
120
- \f[I]L\f[]\f[I]O\f[]\f[I]A\f[]\f[I]D\f[]~\f[I]P\f[]~\f[I]A\f[]\f[I]T\f[]\f[I]H\f[].\f[I]P\f[]\f[I]A\f[]\f[I]T\f[]\f[I]H\f[]\f[I]w\f[]\f[I]i\f[]\f[I]l\f[]\f[I]l\f[]\f[I]b\f[]\f[I]e\f[]\f[I]p\f[]\f[I]r\f[]\f[I]e\f[]\f[I]p\f[]\f[I]e\f[]\f[I]n\f[]\f[I]d\f[]\f[I]e\f[]\f[I]d\f[]\f[I]t\f[]\f[I]o\f[]LOAD_PATH.
118
+ specify $LOAD_PATH. PATH will be prepended to $LOAD_PATH.
121
119
  The \[aq]:\[aq] character may be used to delimit multiple directories.
122
- This directive may be used more than once.
123
- Modifications to $LOAD_PATH take place immediately and in the order they
124
- were specified on the command\-line.
120
+ This directive may be used more than once. Modifications to
121
+ $LOAD_PATH take place immediately and in the order they were
122
+ specified on the command\-line.
125
123
  .RS
126
124
  .RE
127
125
  .TP
128
126
  .B \-r, \-\-require LIBRARY
129
- require a specified LIBRARY before executing the application.
130
- The "require" statement will be executed immediately and in the order
127
+ require a specified LIBRARY before executing the application. The
128
+ "require" statement will be executed immediately and in the order
131
129
  they were specified on the command\-line.
132
130
  .RS
133
131
  .RE
@@ -139,15 +137,15 @@ HUP \- reload config file, app, and gracefully restart all workers
139
137
  .IP \[bu] 2
140
138
  INT/TERM \- quick shutdown, kills all workers immediately
141
139
  .IP \[bu] 2
142
- QUIT \- graceful shutdown, waits for workers to finish their current
143
- request before finishing.
140
+ QUIT \- graceful shutdown, waits for workers to finish their
141
+ current request before finishing.
144
142
  .IP \[bu] 2
145
- USR1 \- reopen all logs owned by the master and all workers See
146
- Unicorn::Util.reopen_logs for what is considered a log.
143
+ USR1 \- reopen all logs owned by the master and all workers
144
+ See Unicorn::Util.reopen_logs for what is considered a log.
147
145
  .IP \[bu] 2
148
- USR2 \- reexecute the running binary.
149
- A separate QUIT should be sent to the original process once the child is
150
- verified to be up and running.
146
+ USR2 \- reexecute the running binary. A separate QUIT
147
+ should be sent to the original process once the child is verified to
148
+ be up and running.
151
149
  .IP \[bu] 2
152
150
  WINCH \- gracefully stops workers but keep the master running.
153
151
  This will only work for daemonized processes.
@@ -156,7 +154,7 @@ TTIN \- increment the number of worker processes by one
156
154
  .IP \[bu] 2
157
155
  TTOU \- decrement the number of worker processes by one
158
156
  .PP
159
- See the SIGNALS (https://bogomips.org/unicorn/SIGNALS.html) document for
157
+ See the SIGNALS (https://yhbt.net/unicorn/SIGNALS.html) document for
160
158
  full description of all signals used by Unicorn.
161
159
  .SH RACK ENVIRONMENT
162
160
  .PP
@@ -164,56 +162,61 @@ Accepted values of RACK_ENV and the middleware they automatically load
164
162
  (outside of RACKUP_FILE) are exactly as those in rackup(1):
165
163
  .IP \[bu] 2
166
164
  development \- loads Rack::CommonLogger, Rack::ShowExceptions, and
167
- Rack::Lint middleware
165
+ Rack::Lint middleware
168
166
  .IP \[bu] 2
169
167
  deployment \- loads Rack::CommonLogger middleware
170
168
  .IP \[bu] 2
171
169
  none \- loads no middleware at all, relying entirely on RACKUP_FILE
172
170
  .PP
173
- All unrecognized values for RACK_ENV are assumed to be "none".
174
- Production deployments are strongly encouraged to use "deployment" or
175
- "none" for maximum performance.
171
+ All unrecognized values for RACK_ENV are assumed to be
172
+ "none". Production deployments are strongly encouraged to use
173
+ "deployment" or "none" for maximum performance.
176
174
  .PP
177
- As of Unicorn 0.94.0, RACK_ENV is exported as a process\-wide
178
- environment variable as well.
179
- While not current a part of the Rack specification as of Rack 1.0.1,
180
- this has become a de facto standard in the Rack world.
175
+ As of Unicorn 0.94.0, RACK_ENV is exported as a process\-wide environment
176
+ variable as well. While not current a part of the Rack specification as
177
+ of Rack 1.0.1, this has become a de facto standard in the Rack world.
181
178
  .PP
182
179
  Note the Rack::ContentLength and Rack::Chunked middlewares are also
183
180
  loaded by "deployment" and "development", but no other values of
184
- RACK_ENV.
185
- If needed, they must be individually specified in the RACKUP_FILE, some
186
- frameworks do not require them.
181
+ RACK_ENV. If needed, they must be individually specified in the
182
+ RACKUP_FILE, some frameworks do not require them.
187
183
  .SH ENVIRONMENT VARIABLES
188
184
  .PP
189
185
  The RACK_ENV variable is set by the aforementioned \-E switch.
190
- All application or library\-specific environment variables (e.g.
191
- TMPDIR) may always be set in the Unicorn CONFIG_FILE in addition to the
192
- spawning shell.
193
- When transparently upgrading Unicorn, all environment variables set in
194
- the old master process are inherited by the new master process.
186
+ All application or library\-specific environment variables (e.g. TMPDIR)
187
+ may always be set in the Unicorn CONFIG_FILE in addition to the spawning
188
+ shell. When transparently upgrading Unicorn, all environment variables
189
+ set in the old master process are inherited by the new master process.
195
190
  Unicorn only uses (and will overwrite) the UNICORN_FD environment
196
191
  variable internally when doing transparent upgrades.
197
192
  .PP
198
193
  UNICORN_FD is a comma\-delimited list of one or more file descriptors
199
- used to implement USR2 upgrades.
200
- Init systems may bind listen sockets itself and spawn unicorn with
201
- UNICORN_FD set to the file descriptor numbers of the listen socket(s).
194
+ used to implement USR2 upgrades. Init systems may bind listen sockets
195
+ itself and spawn unicorn with UNICORN_FD set to the file descriptor
196
+ numbers of the listen socket(s).
202
197
  .PP
203
198
  As of unicorn 5.0, LISTEN_PID and LISTEN_FDS are used for socket
204
- activation as documented in the sd_listen_fds(3) manpage.
205
- Users relying on this feature do not need to specify a listen socket in
199
+ activation as documented in the sd_listen_fds(3) manpage. Users
200
+ relying on this feature do not need to specify a listen socket in
206
201
  the unicorn config file.
207
202
  .SH SEE ALSO
208
203
  .IP \[bu] 2
209
204
  \f[I]Rack::Builder\f[] ri/RDoc
210
205
  .IP \[bu] 2
211
206
  \f[I]Unicorn::Configurator\f[] ri/RDoc
207
+ .UR https://yhbt.net/unicorn/Unicorn/Configurator.html
208
+ .UE
212
209
  .IP \[bu] 2
213
- Unicorn RDoc (https://bogomips.org/unicorn/)
210
+ unicorn RDoc
211
+ .UR https://yhbt.net/unicorn/
212
+ .UE
214
213
  .IP \[bu] 2
215
- Rack RDoc (http://www.rubydoc.info/github/rack/rack/)
214
+ Rack RDoc
215
+ .UR https://www.rubydoc.info/github/rack/rack/
216
+ .UE
216
217
  .IP \[bu] 2
217
- Rackup HowTo (https://github.com/rack/rack/wiki/tutorial-rackup-howto)
218
+ Rackup HowTo
219
+ .UR https://github.com/rack/rack/wiki/(tutorial)-rackup-howto
220
+ .UE
218
221
  .SH AUTHORS
219
- The Unicorn Community <unicorn-public@bogomips.org>.
222
+ The Unicorn Community <unicorn-public@yhbt.net>.
@@ -1,4 +1,5 @@
1
1
  .TH "UNICORN_RAILS" "1" "September 17, 2009" "Unicorn User Manual" ""
2
+ .hy
2
3
  .SH NAME
3
4
  .PP
4
5
  unicorn_rails \- unicorn launcher for Rails 1.x and 2.x users
@@ -7,17 +8,12 @@ unicorn_rails \- unicorn launcher for Rails 1.x and 2.x users
7
8
  unicorn_rails [\-c CONFIG_FILE] [\-E RAILS_ENV] [\-D] [RACKUP_FILE]
8
9
  .SH DESCRIPTION
9
10
  .PP
10
- A rackup(1)\-like command to launch Rails applications using Unicorn.
11
- It is expected to be started in your Rails application root
12
- (RAILS_ROOT), but the "working_directory" directive may be used in the
13
- CONFIG_FILE.
11
+ A rackup(1)\-like command to launch ancient Rails (2.x and earlier)
12
+ applications using Unicorn. Rails 3 (and later) support Rack natively,
13
+ so users are encouraged to use unicorn(1) instead of unicorn_rails(1).
14
14
  .PP
15
- It is designed to help Rails 1.x and 2.y users transition to Rack, but
16
- it is NOT needed for Rails 3 applications.
17
- Rails 3 users are encouraged to use unicorn(1) instead of
18
- unicorn_rails(1).
19
- Users of Rails 1.x/2.y may also use unicorn(1) instead of
20
- unicorn_rails(1).
15
+ It is expected to be started in your Rails application root (RAILS_ROOT),
16
+ but the "working_directory" directive may be used in the CONFIG_FILE.
21
17
  .PP
22
18
  The outward interface resembles rackup(1), the internals and default
23
19
  middleware loading is designed like the \f[C]script/server\f[] command
@@ -30,56 +26,55 @@ as much as possible.
30
26
  .SH UNICORN OPTIONS
31
27
  .TP
32
28
  .B \-c, \-\-config\-file CONFIG_FILE
33
- Path to the Unicorn\-specific config file.
34
- The config file is implemented as a Ruby DSL, so Ruby code may executed.
35
- See the RDoc/ri for the \f[I]Unicorn::Configurator\f[] class for the
36
- full list of directives available from the DSL.
37
- Using an absolute path for for CONFIG_FILE is recommended as it makes
38
- multiple instances of Unicorn easily distinguishable when viewing ps(1)
39
- output.
29
+ Path to the Unicorn\-specific config file. The config file is
30
+ implemented as a Ruby DSL, so Ruby code may executed.
31
+ See the RDoc/ri for the \f[I]Unicorn::Configurator\f[] class for the full
32
+ list of directives available from the DSL.
33
+ Using an absolute path for for CONFIG_FILE is recommended as it
34
+ makes multiple instances of Unicorn easily distinguishable when
35
+ viewing ps(1) output.
40
36
  .RS
41
37
  .RE
42
38
  .TP
43
39
  .B \-D, \-\-daemonize
44
- Run daemonized in the background.
45
- The process is detached from the controlling terminal and stdin is
46
- redirected to "/dev/null".
40
+ Run daemonized in the background. The process is detached from
41
+ the controlling terminal and stdin is redirected to "/dev/null".
47
42
  Unlike many common UNIX daemons, we do not chdir to "/" upon
48
- daemonization to allow more control over the startup/upgrade process.
49
- Unless specified in the CONFIG_FILE, stderr and stdout will also be
50
- redirected to "/dev/null".
43
+ daemonization to allow more control over the startup/upgrade
44
+ process.
45
+ Unless specified in the CONFIG_FILE, stderr and stdout will
46
+ also be redirected to "/dev/null".
51
47
  Daemonization will \f[I]skip\f[] loading of the
52
- \f[I]Rails::Rack::LogTailer\f[] middleware under Rails >= 2.3.x.
48
+ \f[I]Rails::Rack::LogTailer\f[]
49
+ middleware under Rails >= 2.3.x.
53
50
  By default, unicorn_rails(1) will create a PID file in
54
- \f[I]"RAILS_ROOT/tmp/pids/unicorn.pid"\f[].
55
- You may override this by specifying the "pid" directive to override this
56
- Unicorn config file.
51
+ \f[I]"RAILS_ROOT/tmp/pids/unicorn.pid"\f[]. You may override this
52
+ by specifying the "pid" directive to override this Unicorn config file.
57
53
  .RS
58
54
  .RE
59
55
  .TP
60
56
  .B \-E, \-\-env RAILS_ENV
61
- Run under the given RAILS_ENV.
62
- This sets the RAILS_ENV environment variable.
63
- Acceptable values are exactly those you expect in your Rails
57
+ Run under the given RAILS_ENV. This sets the RAILS_ENV environment
58
+ variable. Acceptable values are exactly those you expect in your Rails
64
59
  application, typically "development" or "production".
65
60
  .RS
66
61
  .RE
67
62
  .TP
68
63
  .B \-l, \-\-listen ADDRESS
69
- Listens on a given ADDRESS.
70
- ADDRESS may be in the form of HOST:PORT or PATH, HOST:PORT is taken to
71
- mean a TCP socket and PATH is meant to be a path to a UNIX domain
72
- socket.
64
+ Listens on a given ADDRESS. ADDRESS may be in the form of
65
+ HOST:PORT or PATH, HOST:PORT is taken to mean a TCP socket
66
+ and PATH is meant to be a path to a UNIX domain socket.
73
67
  Defaults to "0.0.0.0:8080" (all addresses on TCP port 8080).
74
68
  For production deployments, specifying the "listen" directive in
75
- CONFIG_FILE is recommended as it allows fine\-tuning of socket options.
69
+ CONFIG_FILE is recommended as it allows fine\-tuning of socket
70
+ options.
76
71
  .RS
77
72
  .RE
78
73
  .SH RACKUP COMPATIBILITY OPTIONS
79
74
  .TP
80
75
  .B \-o, \-\-host HOST
81
- Listen on a TCP socket belonging to HOST, default is "0.0.0.0" (all
82
- addresses).
76
+ Listen on a TCP socket belonging to HOST, default is
77
+ "0.0.0.0" (all addresses).
83
78
  If specified multiple times on the command\-line, only the
84
79
  last\-specified value takes effect.
85
80
  This option only exists for compatibility with the rackup(1) command,
@@ -89,8 +84,8 @@ use of "\-l"/"\-\-listen" switch is recommended instead.
89
84
  .TP
90
85
  .B \-p, \-\-port PORT
91
86
  Listen on the specified TCP PORT, default is 8080.
92
- If specified multiple times on the command\-line, only the
93
- last\-specified value takes effect.
87
+ If specified multiple times on the command\-line, only the last\-specified
88
+ value takes effect.
94
89
  This option only exists for compatibility with the rackup(1) command,
95
90
  use of "\-l"/"\-\-listen" switch is recommended instead.
96
91
  .RS
@@ -98,17 +93,16 @@ use of "\-l"/"\-\-listen" switch is recommended instead.
98
93
  .TP
99
94
  .B \-\-path PATH
100
95
  Mounts the Rails application at the given PATH (instead of "/").
101
- This is equivalent to setting the RAILS_RELATIVE_URL_ROOT environment
102
- variable.
103
- This is only supported under Rails 2.3 or later at the moment.
96
+ This is equivalent to setting the RAILS_RELATIVE_URL_ROOT
97
+ environment variable. This is only supported under Rails 2.3
98
+ or later at the moment.
104
99
  .RS
105
100
  .RE
106
101
  .SH RUBY OPTIONS
107
102
  .TP
108
103
  .B \-e, \-\-eval LINE
109
- Evaluate a LINE of Ruby code.
110
- This evaluation happens immediately as the command\-line is being
111
- parsed.
104
+ Evaluate a LINE of Ruby code. This evaluation happens
105
+ immediately as the command\-line is being parsed.
112
106
  .RS
113
107
  .RE
114
108
  .TP
@@ -125,46 +119,42 @@ Turn on verbose warnings, the $VERBOSE variable is set to true.
125
119
  .RE
126
120
  .TP
127
121
  .B \-I, \-\-include PATH
128
- specify
129
- \f[I]L\f[]\f[I]O\f[]\f[I]A\f[]\f[I]D\f[]~\f[I]P\f[]~\f[I]A\f[]\f[I]T\f[]\f[I]H\f[].\f[I]P\f[]\f[I]A\f[]\f[I]T\f[]\f[I]H\f[]\f[I]w\f[]\f[I]i\f[]\f[I]l\f[]\f[I]l\f[]\f[I]b\f[]\f[I]e\f[]\f[I]p\f[]\f[I]r\f[]\f[I]e\f[]\f[I]p\f[]\f[I]e\f[]\f[I]n\f[]\f[I]d\f[]\f[I]e\f[]\f[I]d\f[]\f[I]t\f[]\f[I]o\f[]LOAD_PATH.
122
+ specify $LOAD_PATH. PATH will be prepended to $LOAD_PATH.
130
123
  The \[aq]:\[aq] character may be used to delimit multiple directories.
131
- This directive may be used more than once.
132
- Modifications to $LOAD_PATH take place immediately and in the order they
133
- were specified on the command\-line.
124
+ This directive may be used more than once. Modifications to
125
+ $LOAD_PATH take place immediately and in the order they were
126
+ specified on the command\-line.
134
127
  .RS
135
128
  .RE
136
129
  .TP
137
130
  .B \-r, \-\-require LIBRARY
138
- require a specified LIBRARY before executing the application.
139
- The "require" statement will be executed immediately and in the order
131
+ require a specified LIBRARY before executing the application. The
132
+ "require" statement will be executed immediately and in the order
140
133
  they were specified on the command\-line.
141
134
  .RS
142
135
  .RE
143
136
  .SH RACKUP FILE
144
137
  .PP
145
- This defaults to "config.ru" in RAILS_ROOT.
146
- It should be the same file used by rackup(1) and other Rack launchers,
147
- it uses the \f[I]Rack::Builder\f[] DSL.
148
- Unlike many other Rack applications, RACKUP_FILE is completely
149
- \f[I]optional\f[] for Rails, but may be used to disable some of the
150
- default middleware for performance.
138
+ This defaults to "config.ru" in RAILS_ROOT. It should be the same
139
+ file used by rackup(1) and other Rack launchers, it uses the
140
+ \f[I]Rack::Builder\f[] DSL. Unlike many other Rack applications, RACKUP_FILE
141
+ is completely \f[I]optional\f[] for Rails, but may be used to disable
142
+ some of the default middleware for performance.
151
143
  .PP
152
- Embedded command\-line options are mostly parsed for compatibility with
153
- rackup(1) but strongly discouraged.
144
+ Embedded command\-line options are mostly parsed for compatibility
145
+ with rackup(1) but strongly discouraged.
154
146
  .SH ENVIRONMENT VARIABLES
155
147
  .PP
156
- The RAILS_ENV variable is set by the aforementioned \-E switch.
157
- The RAILS_RELATIVE_URL_ROOT is set by the aforementioned \-\-path
158
- switch.
148
+ The RAILS_ENV variable is set by the aforementioned \-E switch. The
149
+ RAILS_RELATIVE_URL_ROOT is set by the aforementioned \-\-path switch.
159
150
  Either of these variables may also be set in the shell or the Unicorn
160
- CONFIG_FILE.
161
- All application or library\-specific environment variables (e.g.
162
- TMPDIR, RAILS_ASSET_ID) may always be set in the Unicorn CONFIG_FILE in
163
- addition to the spawning shell.
164
- When transparently upgrading Unicorn, all environment variables set in
165
- the old master process are inherited by the new master process.
166
- Unicorn only uses (and will overwrite) the UNICORN_FD environment
167
- variable internally when doing transparent upgrades.
151
+ CONFIG_FILE. All application or library\-specific environment variables
152
+ (e.g. TMPDIR, RAILS_ASSET_ID) may always be set in the Unicorn
153
+ CONFIG_FILE in addition to the spawning shell. When transparently
154
+ upgrading Unicorn, all environment variables set in the old master
155
+ process are inherited by the new master process. Unicorn only uses (and
156
+ will overwrite) the UNICORN_FD environment variable internally when
157
+ doing transparent upgrades.
168
158
  .SH SIGNALS
169
159
  .PP
170
160
  The following UNIX signals may be sent to the master process:
@@ -176,12 +166,12 @@ INT/TERM \- quick shutdown, kills all workers immediately
176
166
  QUIT \- graceful shutdown, waits for workers to finish their current
177
167
  request before finishing.
178
168
  .IP \[bu] 2
179
- USR1 \- reopen all logs owned by the master and all workers See
180
- Unicorn::Util.reopen_logs for what is considered a log.
169
+ USR1 \- reopen all logs owned by the master and all workers
170
+ See Unicorn::Util.reopen_logs for what is considered a log.
181
171
  .IP \[bu] 2
182
- USR2 \- reexecute the running binary.
183
- A separate QUIT should be sent to the original process once the child is
184
- verified to be up and running.
172
+ USR2 \- reexecute the running binary. A separate QUIT
173
+ should be sent to the original process once the child is verified to
174
+ be up and running.
185
175
  .IP \[bu] 2
186
176
  WINCH \- gracefully stops workers but keep the master running.
187
177
  This will only work for daemonized processes.
@@ -190,7 +180,7 @@ TTIN \- increment the number of worker processes by one
190
180
  .IP \[bu] 2
191
181
  TTOU \- decrement the number of worker processes by one
192
182
  .PP
193
- See the SIGNALS (https://bogomips.org/unicorn/SIGNALS.html) document for
183
+ See the SIGNALS (https://yhbt.net/unicorn/SIGNALS.html) document for
194
184
  full description of all signals used by Unicorn.
195
185
  .SH SEE ALSO
196
186
  .IP \[bu] 2
@@ -199,11 +189,19 @@ unicorn(1)
199
189
  \f[I]Rack::Builder\f[] ri/RDoc
200
190
  .IP \[bu] 2
201
191
  \f[I]Unicorn::Configurator\f[] ri/RDoc
192
+ .UR https://yhbt.net/unicorn/Unicorn/Configurator.html
193
+ .UE
202
194
  .IP \[bu] 2
203
- Unicorn RDoc (https://bogomips.org/unicorn/)
195
+ unicorn RDoc
196
+ .UR https://yhbt.net/unicorn/
197
+ .UE
204
198
  .IP \[bu] 2
205
- Rack RDoc (http://www.rubydoc.info/github/rack/rack/)
199
+ Rack RDoc
200
+ .UR https://www.rubydoc.info/github/rack/rack/
201
+ .UE
206
202
  .IP \[bu] 2
207
- Rackup HowTo (https://github.com/rack/rack/wiki/tutorial-rackup-howto)
203
+ Rackup HowTo
204
+ .UR https://github.com/rack/rack/wiki/(tutorial)-rackup-howto
205
+ .UE
208
206
  .SH AUTHORS
209
- The Unicorn Community <unicorn-public@bogomips.org>.
207
+ The Unicorn Community <unicorn-public@yhbt.net>.
data/t/README CHANGED
@@ -10,17 +10,17 @@ comfortable writing integration tests with.
10
10
 
11
11
  == Requirements
12
12
 
13
- * {Ruby 1.9.3+}[https://www.ruby-lang.org/] (duh!)
14
- * {GNU make}[http://www.gnu.org/software/make/]
13
+ * {Ruby 1.9.3+}[https://www.ruby-lang.org/en/] (duh!)
14
+ * {GNU make}[https://www.gnu.org/software/make/]
15
15
  * {socat}[http://www.dest-unreach.org/socat/]
16
- * {curl}[http://curl.haxx.se/]
16
+ * {curl}[https://curl.haxx.se/]
17
17
  * standard UNIX shell utilities (Bourne sh, awk, sed, grep, ...)
18
18
 
19
19
  We do not use bashisms or any non-portable, non-POSIX constructs
20
20
  in our shell code. We use the "pipefail" option if available and
21
21
  mainly test with {ksh}[http://kornshell.com/], but occasionally
22
22
  with {dash}[http://gondor.apana.org.au/~herbert/dash/] and
23
- {bash}[http://www.gnu.org/software/bash/], too.
23
+ {bash}[https://www.gnu.org/software/bash/], too.
24
24
 
25
25
  == Running Tests
26
26
 
@@ -0,0 +1,25 @@
1
+ #!/bin/sh
2
+ . ./test-lib.sh
3
+ t_plan 3 "-N / --no-default-middleware option not supported in config.ru"
4
+
5
+ t_begin "setup and start" && {
6
+ unicorn_setup
7
+ RACK_ENV=development unicorn -D -c $unicorn_config t0301.ru
8
+ unicorn_wait_start
9
+ }
10
+
11
+ t_begin "check switches parsed as expected and -N ignored for Rack::Lint" && {
12
+ debug=false
13
+ lint=
14
+ eval "$(curl -sf http://$listen/vars)"
15
+ test x"$debug" = xtrue
16
+ test x"$lint" != x
17
+ test -f "$lint"
18
+ }
19
+
20
+ t_begin "killing succeeds" && {
21
+ kill $unicorn_pid
22
+ check_stderr
23
+ }
24
+
25
+ t_done
data/t/t0301.ru ADDED
@@ -0,0 +1,13 @@
1
+ #\-N --debug
2
+ run(lambda do |env|
3
+ case env['PATH_INFO']
4
+ when '/vars'
5
+ b = "debug=#{$DEBUG.inspect}\n" \
6
+ "lint=#{caller.grep(%r{rack/lint\.rb})[0].split(':')[0]}\n"
7
+ end
8
+ h = {
9
+ 'Content-Length' => b.size.to_s,
10
+ 'Content-Type' => 'text/plain',
11
+ }
12
+ [ 200, h, [ b ] ]
13
+ end)
@@ -42,9 +42,19 @@ The benchmark client is usually httperf.
42
42
  Another gentle reminder: performance with slow networks/clients
43
43
  is NOT our problem. That is the job of nginx (or similar).
44
44
 
45
+ == ddstream.ru
46
+
47
+ Standalone Rack app intended to show how BAD we are at slow clients.
48
+ See usage in comments.
49
+
50
+ == readinput.ru
51
+
52
+ Standalone Rack app intended to show how bad we are with slow uploaders.
53
+ See usage in comments.
54
+
45
55
  == Contributors
46
56
 
47
- This directory is maintained independently in the "benchmark" branch
48
- based against v0.1.0. Only changes to this directory (test/benchmarks)
49
- are committed to this branch although the master branch may merge this
50
- branch occassionaly.
57
+ This directory is intended to remain stable. Do not make changes
58
+ to benchmarking code which can change performance and invalidate
59
+ results across revisions. Instead, write new benchmarks and update
60
+ coments/documentation as necessary.