unicorn 5.4.0 → 5.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.manifest +7 -3
- data/.olddoc.yml +12 -7
- data/Application_Timeouts +4 -4
- data/Documentation/.gitignore +1 -3
- data/Documentation/unicorn.1 +222 -0
- data/Documentation/unicorn_rails.1 +207 -0
- data/FAQ +1 -1
- data/GIT-VERSION-FILE +1 -1
- data/GIT-VERSION-GEN +1 -1
- data/GNUmakefile +16 -6
- data/HACKING +1 -1
- data/ISSUES +17 -22
- data/KNOWN_ISSUES +2 -2
- data/LATEST +18 -8
- data/LICENSE +2 -2
- data/Links +13 -11
- data/NEWS +94 -0
- data/README +18 -11
- data/SIGNALS +1 -1
- data/Sandbox +4 -4
- data/archive/slrnpull.conf +1 -1
- data/bin/unicorn +3 -1
- data/bin/unicorn_rails +2 -2
- data/examples/big_app_gc.rb +1 -1
- data/examples/logrotate.conf +3 -3
- data/examples/nginx.conf +4 -3
- data/examples/unicorn.conf.minimal.rb +2 -2
- data/examples/unicorn.conf.rb +2 -2
- data/examples/unicorn@.service +7 -0
- data/ext/unicorn_http/common_field_optimization.h +24 -6
- data/ext/unicorn_http/extconf.rb +30 -0
- data/ext/unicorn_http/global_variables.h +2 -2
- data/ext/unicorn_http/httpdate.c +2 -2
- data/ext/unicorn_http/unicorn_http.c +257 -224
- data/ext/unicorn_http/unicorn_http.rl +47 -14
- data/lib/unicorn/configurator.rb +25 -4
- data/lib/unicorn/http_request.rb +12 -2
- data/lib/unicorn/http_server.rb +50 -23
- data/lib/unicorn/launcher.rb +1 -1
- data/lib/unicorn/oob_gc.rb +2 -2
- data/lib/unicorn/socket_helper.rb +3 -2
- data/lib/unicorn/tmpio.rb +8 -2
- data/lib/unicorn/util.rb +3 -3
- data/lib/unicorn/version.rb +1 -1
- data/lib/unicorn/worker.rb +16 -2
- data/lib/unicorn.rb +23 -9
- data/man/man1/unicorn.1 +88 -85
- data/man/man1/unicorn_rails.1 +79 -81
- data/t/README +4 -4
- data/t/t0301-no-default-middleware-ignored-in-config.sh +25 -0
- data/t/t0301.ru +13 -0
- data/test/benchmark/README +14 -4
- data/test/benchmark/ddstream.ru +50 -0
- data/test/benchmark/readinput.ru +40 -0
- data/test/benchmark/uconnect.perl +66 -0
- data/test/exec/test_exec.rb +15 -14
- data/test/test_helper.rb +0 -26
- data/test/unit/test_ccc.rb +1 -1
- data/test/unit/test_http_parser.rb +16 -0
- data/test/unit/test_http_parser_ng.rb +81 -0
- data/test/unit/test_server.rb +35 -5
- data/test/unit/test_signals.rb +2 -2
- data/test/unit/test_socket_helper.rb +4 -4
- data/test/unit/test_upload.rb +4 -9
- data/test/unit/test_util.rb +25 -0
- data/unicorn.gemspec +3 -3
- metadata +13 -9
- data/Documentation/GNUmakefile +0 -30
- data/Documentation/unicorn.1.txt +0 -187
- data/Documentation/unicorn_rails.1.txt +0 -175
data/ISSUES
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
= Issues
|
2
2
|
|
3
|
-
mailto:unicorn-public@
|
3
|
+
mailto:unicorn-public@yhbt.net is the best place to report bugs,
|
4
4
|
submit patches and/or obtain support after you have searched the
|
5
|
-
{email archives}[https://
|
6
|
-
{documentation}[https://
|
5
|
+
{email archives}[https://yhbt.net/unicorn-public/] and
|
6
|
+
{documentation}[https://yhbt.net/unicorn/].
|
7
7
|
|
8
8
|
* No subscription will ever be required to email us
|
9
9
|
* Cc: all participants in a thread or commit, as subscription is optional
|
@@ -12,12 +12,12 @@ submit patches and/or obtain support after you have searched the
|
|
12
12
|
* Do not send HTML mail or images,
|
13
13
|
they hurt reader privacy and will be flagged as spam
|
14
14
|
* Anonymous and pseudonymous messages will ALWAYS be welcome
|
15
|
-
* The email submission port (587) is enabled on the
|
16
|
-
https://
|
15
|
+
* The email submission port (587) is enabled on the yhbt.net MX:
|
16
|
+
https://yhbt.net/unicorn-public/20141004232241.GA23908@dcvr.yhbt.net/t/
|
17
17
|
|
18
18
|
We will never have a centralized or formal bug tracker. Instead we
|
19
19
|
can interoperate with any bug tracker which can Cc: us plain-text to
|
20
|
-
mailto:unicorn-public@
|
20
|
+
mailto:unicorn-public@yhbt.net This includes the Debian BTS
|
21
21
|
at https://bugs.debian.org/unicorn and possibly others.
|
22
22
|
|
23
23
|
If your issue is of a sensitive nature or you're just shy in public,
|
@@ -39,6 +39,7 @@ https://bugs.ruby-lang.org/ and discuss+fix them on the ruby-core
|
|
39
39
|
list at mailto:ruby-core@ruby-lang.org
|
40
40
|
Subscription to post is required to ruby-core, unfortunately:
|
41
41
|
mailto:ruby-core-request@ruby-lang.org?subject=subscribe
|
42
|
+
Unofficial archives are available at: https://public-inbox.org/ruby-core/
|
42
43
|
|
43
44
|
For uncommon bugs in Rack, we may forward bugs to
|
44
45
|
mailto:rack-devel@googlegroups.com and discuss there.
|
@@ -46,6 +47,7 @@ Subscription (without any web UI or Google account) is possible via:
|
|
46
47
|
mailto:rack-devel+subscribe@googlegroups.com
|
47
48
|
Note: not everyone can use the proprietary bug tracker used by Rack,
|
48
49
|
but their mailing list remains operational.
|
50
|
+
Unofficial archives are available at: https://public-inbox.org/rack-devel/
|
49
51
|
|
50
52
|
Uncommon bugs we encounter in the Linux kernel should be Cc:-ed to the
|
51
53
|
Linux kernel mailing list (LKML) at mailto:linux-kernel@vger.kernel.org
|
@@ -54,11 +56,12 @@ and subsystem maintainers such as mailto:netdev@vger.kernel.org
|
|
54
56
|
involved with any problematic commits (including those in the
|
55
57
|
Signed-off-by: and other trailer lines). No subscription is necessary,
|
56
58
|
and the our mailing list follows the same conventions as LKML for
|
57
|
-
interopability.
|
58
|
-
ignored by most
|
59
|
+
interopability. Archives are available at https://lore.kernel.org/lkml/
|
60
|
+
There is a kernel.org Bugzilla instance, but it is ignored by most.
|
59
61
|
|
60
62
|
Likewise for any rare glibc bugs we might encounter, we should Cc:
|
61
63
|
mailto:libc-alpha@sourceware.org
|
64
|
+
Unofficial archives are available at: https://public-inbox.org/libc-alpha/
|
62
65
|
Keep in mind glibc upstream does use Bugzilla for tracking bugs:
|
63
66
|
https://sourceware.org/bugzilla/
|
64
67
|
|
@@ -70,10 +73,10 @@ document distributed with git) on guidelines for patch submission.
|
|
70
73
|
|
71
74
|
== Contact Info
|
72
75
|
|
73
|
-
* public: mailto:unicorn-public@
|
74
|
-
* nntp://news.gmane.
|
76
|
+
* public: mailto:unicorn-public@yhbt.net
|
77
|
+
* nntp://news.gmane.io/gmane.comp.lang.ruby.unicorn.general
|
75
78
|
* nntp://news.public-inbox.org/inbox.comp.lang.ruby.unicorn
|
76
|
-
* https://
|
79
|
+
* https://yhbt.net/unicorn-public/
|
77
80
|
* http://ou63pmih66umazou.onion/unicorn-public/
|
78
81
|
|
79
82
|
Mailing list subscription is optional, so Cc: all participants.
|
@@ -81,21 +84,13 @@ Mailing list subscription is optional, so Cc: all participants.
|
|
81
84
|
You can follow along via NNTP (read-only):
|
82
85
|
|
83
86
|
nntp://news.public-inbox.org/inbox.comp.lang.ruby.unicorn
|
84
|
-
nntp://news.gmane.
|
87
|
+
nntp://news.gmane.io/gmane.comp.lang.ruby.unicorn.general
|
85
88
|
|
86
89
|
Or Atom feeds:
|
87
90
|
|
88
|
-
https://
|
91
|
+
https://yhbt.net/unicorn-public/new.atom
|
89
92
|
http://ou63pmih66umazou.onion/unicorn-public/new.atom
|
90
93
|
|
91
|
-
The HTML archives at https://
|
94
|
+
The HTML archives at https://yhbt.net/unicorn-public/
|
92
95
|
also has links to per-thread Atom feeds and downloadable
|
93
96
|
mboxes.
|
94
|
-
|
95
|
-
You may optionally subscribe via plain-text email:
|
96
|
-
|
97
|
-
mailto:unicorn-public+subscribe@bogomips.org
|
98
|
-
(and confirming the auto-reply)
|
99
|
-
|
100
|
-
Just keep in mind we suck at delivering email, so using NNTP,
|
101
|
-
or Atom feeds might be a better bet...
|
data/KNOWN_ISSUES
CHANGED
@@ -9,7 +9,7 @@ acceptable solution. Those issues are documented here.
|
|
9
9
|
handlers.
|
10
10
|
|
11
11
|
* Issues with FreeBSD jails can be worked around as documented by Tatsuya Ono:
|
12
|
-
https://
|
12
|
+
https://yhbt.net/unicorn-public/CAHBuKRj09FdxAgzsefJWotexw-7JYZGJMtgUp_dhjPz9VbKD6Q@mail.gmail.com/
|
13
13
|
|
14
14
|
* PRNGs (pseudo-random number generators) loaded before forking
|
15
15
|
(e.g. "preload_app true") may need to have their internal state
|
@@ -60,7 +60,7 @@ acceptable solution. Those issues are documented here.
|
|
60
60
|
application to use Rails 2.3.2 and you have no other choice, then
|
61
61
|
you may edit your unicorn gemspec and remove the Rack dependency.
|
62
62
|
|
63
|
-
ref: https://
|
63
|
+
ref: https://yhbt.net/unicorn-public/20091014221552.GA30624@dcvr.yhbt.net/
|
64
64
|
Note: the workaround described in the article above only made
|
65
65
|
the issue more subtle and we didn't notice them immediately.
|
66
66
|
|
data/LATEST
CHANGED
@@ -1,13 +1,23 @@
|
|
1
|
-
=== unicorn 5.
|
1
|
+
=== unicorn 5.5.0 / 2019-03-04 00:41 UTC
|
2
2
|
|
3
|
-
|
4
|
-
|
3
|
+
Mostly identical to 5.5.0.pre1, which I didn't hear any feedback
|
4
|
+
from:
|
5
5
|
|
6
|
-
|
6
|
+
https://bogomips.org/unicorn-public/20181220222842.GA27382@dcvr/
|
7
7
|
|
8
|
-
|
9
|
-
|
8
|
+
> Jeremy Evans contributed the "default_middleware" configuration option:
|
9
|
+
>
|
10
|
+
> https://bogomips.org/unicorn-public/20180913192055.GD48926@jeremyevans.local/
|
11
|
+
>
|
12
|
+
> Jeremy also contributed the ability to use separate groups for the process
|
13
|
+
> and log files:
|
14
|
+
>
|
15
|
+
> https://bogomips.org/unicorn-public/20180913192449.GE48926@jeremyevans.local/
|
16
|
+
>
|
17
|
+
> There's also a couple of uninteresting minor optimizations and
|
18
|
+
> documentation additions.
|
10
19
|
|
11
|
-
|
12
|
-
|
20
|
+
Otherwise, there's one extra change to use
|
21
|
+
rb_gc_register_mark_object which is finally a documented part of
|
22
|
+
the Ruby C-API, but has existed since the 1.9 days.
|
13
23
|
|
data/LICENSE
CHANGED
@@ -8,8 +8,8 @@ any later version. We currently prefer the GPLv3 or later for
|
|
8
8
|
derivative works, but the GPLv2 is fine.
|
9
9
|
|
10
10
|
The complete texts of the GPLv2 and GPLv3 are below:
|
11
|
-
GPLv2 -
|
12
|
-
GPLv3 -
|
11
|
+
GPLv2 - https://www.gnu.org/licenses/gpl-2.0.txt
|
12
|
+
GPLv3 - https://www.gnu.org/licenses/gpl-3.0.txt
|
13
13
|
|
14
14
|
You may (against our _preference_) also use the Ruby 1.8 license terms
|
15
15
|
which we inherited from the original Mongrel project when we forked it:
|
data/Links
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
If you're interested in unicorn, you may be interested in some of the projects
|
4
4
|
listed below. If you have any links to add/change/remove, please tell us at
|
5
|
-
mailto:unicorn-public@
|
5
|
+
mailto:unicorn-public@yhbt.net!
|
6
6
|
|
7
7
|
== Disclaimer
|
8
8
|
|
@@ -10,7 +10,7 @@ The unicorn project is not responsible for the content in these links.
|
|
10
10
|
Furthermore, the unicorn project has never, does not and will never endorse:
|
11
11
|
|
12
12
|
* any for-profit entities or services
|
13
|
-
* any non-{Free Software}[
|
13
|
+
* any non-{Free Software}[https://www.gnu.org/philosophy/free-sw.html]
|
14
14
|
|
15
15
|
The existence of these links does not imply endorsement of any entities
|
16
16
|
or services behind them.
|
@@ -23,34 +23,36 @@ or services behind them.
|
|
23
23
|
* {golden_brindle}[https://github.com/simonoff/golden_brindle] - tool to
|
24
24
|
manage multiple unicorn instances/applications on a single server
|
25
25
|
|
26
|
-
* {raindrops}[https://
|
26
|
+
* {raindrops}[https://yhbt.net/raindrops/] - real-time stats for
|
27
27
|
preforking Rack servers
|
28
28
|
|
29
|
-
* {UnXF}[https://
|
29
|
+
* {UnXF}[https://yhbt.net/unxf/] Un-X-Forward* the Rack environment,
|
30
30
|
useful since unicorn is designed to be deployed behind a reverse proxy.
|
31
31
|
|
32
32
|
=== unicorn is written to work with
|
33
33
|
|
34
|
-
* {Rack}[
|
34
|
+
* {Rack}[https://rack.github.io/] - a minimal interface between webservers
|
35
35
|
supporting Ruby and Ruby frameworks
|
36
36
|
|
37
37
|
* {Ruby}[https://www.ruby-lang.org/en/] - the programming language of
|
38
38
|
Rack and unicorn
|
39
39
|
|
40
|
-
* {nginx}[
|
40
|
+
* {nginx}[https://nginx.org/] (Free versions) -
|
41
41
|
the reverse proxy for use with unicorn
|
42
42
|
|
43
43
|
=== Derivatives
|
44
44
|
|
45
|
-
* {Green Unicorn}[
|
45
|
+
* {Green Unicorn}[https://gunicorn.org/] - a Python version of unicorn
|
46
46
|
|
47
|
-
* {Starman}[
|
47
|
+
* {Starman}[https://metacpan.org/release/Starman/] - Plack/PSGI version
|
48
48
|
of unicorn
|
49
49
|
|
50
50
|
=== Prior Work
|
51
51
|
|
52
|
-
* {Mongrel}[
|
53
|
-
unicorn is based on
|
52
|
+
* {Mongrel}[https://rubygems.org/gems/mongrel] - the awesome webserver
|
53
|
+
unicorn is based on. A historical archive of the mongrel dev list
|
54
|
+
featuring early discussions of unicorn is available at:
|
55
|
+
https://yhbt.net/mongrel-devel/
|
54
56
|
|
55
|
-
* {david}[https://
|
57
|
+
* {david}[https://yhbt.net/david.git] - a tool to explain why you need
|
56
58
|
nginx in front of unicorn
|
data/NEWS
CHANGED
@@ -1,3 +1,97 @@
|
|
1
|
+
=== unicorn 5.5.0 / 2019-03-04 00:41 UTC
|
2
|
+
|
3
|
+
Mostly identical to 5.5.0.pre1, which I didn't hear any feedback
|
4
|
+
from:
|
5
|
+
|
6
|
+
https://bogomips.org/unicorn-public/20181220222842.GA27382@dcvr/
|
7
|
+
|
8
|
+
> Jeremy Evans contributed the "default_middleware" configuration option:
|
9
|
+
>
|
10
|
+
> https://bogomips.org/unicorn-public/20180913192055.GD48926@jeremyevans.local/
|
11
|
+
>
|
12
|
+
> Jeremy also contributed the ability to use separate groups for the process
|
13
|
+
> and log files:
|
14
|
+
>
|
15
|
+
> https://bogomips.org/unicorn-public/20180913192449.GE48926@jeremyevans.local/
|
16
|
+
>
|
17
|
+
> There's also a couple of uninteresting minor optimizations and
|
18
|
+
> documentation additions.
|
19
|
+
|
20
|
+
Otherwise, there's one extra change to use
|
21
|
+
rb_gc_register_mark_object which is finally a documented part of
|
22
|
+
the Ruby C-API, but has existed since the 1.9 days.
|
23
|
+
|
24
|
+
=== unicorn 5.5.0.pre1 / 2018-12-20 20:11 UTC
|
25
|
+
|
26
|
+
Jeremy Evans contributed the "default_middleware" configuration option:
|
27
|
+
|
28
|
+
https://bogomips.org/unicorn-public/20180913192055.GD48926@jeremyevans.local/
|
29
|
+
|
30
|
+
Jeremy also contributed the ability to use separate groups for the process
|
31
|
+
and log files:
|
32
|
+
|
33
|
+
https://bogomips.org/unicorn-public/20180913192449.GE48926@jeremyevans.local/
|
34
|
+
|
35
|
+
There's also a couple of uninteresting minor optimizations and
|
36
|
+
documentation additions.
|
37
|
+
|
38
|
+
Eric Wong (10):
|
39
|
+
remove random seed reset atfork
|
40
|
+
use IO#wait instead of kgio_wait_readable
|
41
|
+
Merge branch '5.4-stable'
|
42
|
+
shrink pipes under Linux
|
43
|
+
socket_helper: add hint for FreeBSD users for accf_http(9)
|
44
|
+
tests: ensure -N/--no-default-middleware not supported in config.ru
|
45
|
+
doc: update more URLs to use HTTPS and avoid redirects
|
46
|
+
deduplicate strings VM-wide in Ruby 2.5+
|
47
|
+
doc/ISSUES: add links to git clone-able mail archives of our dependencies
|
48
|
+
README: minor updates and additional disclaimer
|
49
|
+
|
50
|
+
Jeremy Evans (2):
|
51
|
+
Make Worker#user support different process primary group and log file group
|
52
|
+
Support default_middleware configuration option
|
53
|
+
|
54
|
+
=== unicorn 5.4.1 / 2018-07-23 17:13 UTC
|
55
|
+
|
56
|
+
This release quiets some warnings for Ruby 2.6 preview releases
|
57
|
+
and enables tests to pass under Ruby 1.9.3. Otherwise, nothing
|
58
|
+
interesting for Ruby 2.0..2.5 users. *YAWN*
|
59
|
+
|
60
|
+
Eric Wong (1):
|
61
|
+
quiet some mismatched indentation warnings
|
62
|
+
|
63
|
+
Fumiaki MATSUSHIMA (1):
|
64
|
+
Use IO#wait instead to fix test for Ruby 1.9
|
65
|
+
|
66
|
+
=== unicorn 5.4.0 / 2017-12-23 23:33 UTC
|
67
|
+
|
68
|
+
Rack hijack support improves as the app code can capture and use
|
69
|
+
the Rack `env' privately without copying it (to avoid clobbering
|
70
|
+
by another client). Thanks to Sam Saffron for reporting and
|
71
|
+
testing this new feature:
|
72
|
+
https://bogomips.org/unicorn-public/CAAtdryPG3nLuyo0jxfYW1YHu1Q+ZpkLkd4KdWC8vA46B5haZxw@mail.gmail.com/T/
|
73
|
+
|
74
|
+
We also now support $DEBUG being set by the Rack app (instead of
|
75
|
+
relying on the "-d" CLI switch). Thanks to James P Robinson Jr
|
76
|
+
for reporting this bug:
|
77
|
+
https://bogomips.org/unicorn-public/D6324CB4.7BC3E%25james.robinson3@cigna.com/T/
|
78
|
+
(Coincidentally, this fix will be irrelevant for Ruby 2.5
|
79
|
+
which requires 'pp' by default)
|
80
|
+
|
81
|
+
There's a few minor test cleanups and documentation updates, too.
|
82
|
+
|
83
|
+
All commits since v5.3.1 (2017-10-03):
|
84
|
+
|
85
|
+
reduce method calls with String#start_with?
|
86
|
+
require 'pp' if $DEBUG is set by Rack app
|
87
|
+
avoid reusing env on hijack
|
88
|
+
tests: cleanup some unused variable warnings
|
89
|
+
ISSUES: add a note about Debian BTS interopability
|
90
|
+
|
91
|
+
Roughly all mailing discussions since the last release:
|
92
|
+
|
93
|
+
https://bogomips.org/unicorn-public/?q=d:20171004..20171223
|
94
|
+
|
1
95
|
=== unicorn 5.3.1 / 2017-10-03 19:03 UTC
|
2
96
|
|
3
97
|
This release fixes an occasional GC problem introduced in v5.3.0
|
data/README
CHANGED
@@ -10,7 +10,7 @@ both the the request and response in between unicorn and slow clients.
|
|
10
10
|
|
11
11
|
* Designed for Rack, Unix, fast clients, and ease-of-debugging. We
|
12
12
|
cut out everything that is better supported by the operating system,
|
13
|
-
{nginx}[
|
13
|
+
{nginx}[https://nginx.org/] or {Rack}[https://rack.github.io/].
|
14
14
|
|
15
15
|
* Compatible with Ruby 1.9.3 and later.
|
16
16
|
unicorn 4.x remains supported for Ruby 1.8 users.
|
@@ -37,12 +37,15 @@ both the the request and response in between unicorn and slow clients.
|
|
37
37
|
You can upgrade unicorn, your entire application, libraries
|
38
38
|
and even your Ruby interpreter without dropping clients.
|
39
39
|
|
40
|
+
* transparent upgrades using systemd socket activation is
|
41
|
+
supported since unicorn 5.0
|
42
|
+
|
40
43
|
* before_fork and after_fork hooks in case your application
|
41
44
|
has special needs when dealing with forked processes. These
|
42
45
|
should not be needed when the "preload_app" directive is
|
43
46
|
false (the default).
|
44
47
|
|
45
|
-
* Can be used with copy-on-write-friendly
|
48
|
+
* Can be used with copy-on-write-friendly GC in Ruby 2.0+
|
46
49
|
to save memory (by setting "preload_app" to true).
|
47
50
|
|
48
51
|
* Able to listen on multiple interfaces including UNIX sockets,
|
@@ -55,7 +58,7 @@ both the the request and response in between unicorn and slow clients.
|
|
55
58
|
|
56
59
|
== License
|
57
60
|
|
58
|
-
unicorn is copyright 2009-
|
61
|
+
unicorn is copyright 2009-2018 by all contributors (see logs in git).
|
59
62
|
It is based on Mongrel 1.1.5.
|
60
63
|
Mongrel is copyright 2007 Zed A. Shaw and contributors.
|
61
64
|
|
@@ -77,13 +80,13 @@ You may install it via RubyGems on RubyGems.org:
|
|
77
80
|
You can get the latest source via git from the following locations
|
78
81
|
(these versions may not be stable):
|
79
82
|
|
80
|
-
|
81
|
-
|
83
|
+
https://yhbt.net/unicorn.git
|
84
|
+
https://repo.or.cz/unicorn.git (mirror)
|
82
85
|
|
83
86
|
You may browse the code from the web:
|
84
87
|
|
85
|
-
* https://
|
86
|
-
*
|
88
|
+
* https://yhbt.net/unicorn.git
|
89
|
+
* https://repo.or.cz/w/unicorn.git (gitweb)
|
87
90
|
|
88
91
|
See the HACKING guide on how to contribute and build prerelease gems
|
89
92
|
from git.
|
@@ -122,17 +125,21 @@ unicorn is designed to only serve fast clients either on the local host
|
|
122
125
|
or a fast LAN. See the PHILOSOPHY and DESIGN documents for more details
|
123
126
|
regarding this.
|
124
127
|
|
128
|
+
Due to its ability to tolerate crashes and isolate clients, unicorn
|
129
|
+
is unfortunately known to prolong the existence of bugs in applications
|
130
|
+
and libraries which run on top of it.
|
131
|
+
|
125
132
|
== Contact
|
126
133
|
|
127
134
|
All feedback (bug reports, user/development dicussion, patches, pull
|
128
135
|
requests) go to the mailing list/newsgroup. See the ISSUES document for
|
129
|
-
information on the {mailing list}[mailto:unicorn-public@
|
136
|
+
information on the {mailing list}[mailto:unicorn-public@yhbt.net].
|
130
137
|
|
131
|
-
The mailing list is archived at https://
|
138
|
+
The mailing list is archived at https://yhbt.net/unicorn-public/
|
132
139
|
Read-only NNTP access is available at:
|
133
140
|
nntp://news.public-inbox.org/inbox.comp.lang.ruby.unicorn and
|
134
|
-
nntp://news.gmane.
|
141
|
+
nntp://news.gmane.io/gmane.comp.lang.ruby.unicorn.general
|
135
142
|
|
136
143
|
For the latest on unicorn releases, you may also finger us at
|
137
|
-
unicorn@
|
144
|
+
unicorn@yhbt.net or check our NEWS page (and subscribe to our Atom
|
138
145
|
feed).
|
data/SIGNALS
CHANGED
@@ -8,7 +8,7 @@ should be possible to easily share process management scripts between
|
|
8
8
|
Unicorn and nginx.
|
9
9
|
|
10
10
|
One example init script is distributed with unicorn:
|
11
|
-
https://
|
11
|
+
https://yhbt.net/unicorn/examples/init.sh
|
12
12
|
|
13
13
|
=== Master Process
|
14
14
|
|
data/Sandbox
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
Since unicorn includes executables and is usually used to start a Ruby
|
4
4
|
process, there are certain caveats to using it with tools that sandbox
|
5
5
|
RubyGems installations such as
|
6
|
-
{Bundler}[
|
6
|
+
{Bundler}[https://bundler.io/] or
|
7
7
|
{Isolate}[https://github.com/jbarnette/isolate].
|
8
8
|
|
9
9
|
== General deployment
|
@@ -34,7 +34,7 @@ is the primary issue with sandboxing tools such as Bundler and Isolate.
|
|
34
34
|
If you're bundling unicorn, use "bundle exec unicorn" (or "bundle exec
|
35
35
|
unicorn_rails") to start unicorn with the correct environment variables
|
36
36
|
|
37
|
-
ref: https://
|
37
|
+
ref: https://yhbt.net/unicorn-public/9ECF07C4-5216-47BE-961D-AFC0F0C82060@internetfamo.us/
|
38
38
|
|
39
39
|
Otherwise (if you choose to not sandbox your unicorn installation), we
|
40
40
|
expect the tips for Isolate (below) apply, too.
|
@@ -44,7 +44,7 @@ expect the tips for Isolate (below) apply, too.
|
|
44
44
|
This is no longer be an issue as of bundler 0.9.17
|
45
45
|
|
46
46
|
ref:
|
47
|
-
https://
|
47
|
+
https://yhbt.net/unicorn-public/8FC34B23-5994-41CC-B5AF-7198EF06909E@tramchase.com/
|
48
48
|
|
49
49
|
=== BUNDLE_GEMFILE for Capistrano users
|
50
50
|
|
@@ -66,7 +66,7 @@ before_exec hook as illustrated by https://gist.github.com/534668
|
|
66
66
|
Ruby 2.0.0 enforces FD_CLOEXEC on file descriptors by default. unicorn
|
67
67
|
has been prepared for this behavior since unicorn 4.1.0, and bundler
|
68
68
|
needs the "--keep-file-descriptors" option for "bundle exec":
|
69
|
-
|
69
|
+
https://bundler.io/man/bundle-exec.1.html
|
70
70
|
|
71
71
|
== Isolate
|
72
72
|
|
data/archive/slrnpull.conf
CHANGED
data/bin/unicorn
CHANGED
@@ -6,6 +6,7 @@ require 'optparse'
|
|
6
6
|
ENV["RACK_ENV"] ||= "development"
|
7
7
|
rackup_opts = Unicorn::Configurator::RACKUP
|
8
8
|
options = rackup_opts[:options]
|
9
|
+
set_no_default_middleware = true
|
9
10
|
|
10
11
|
op = OptionParser.new("", 24, ' ') do |opts|
|
11
12
|
cmd = File.basename($0)
|
@@ -60,7 +61,7 @@ op = OptionParser.new("", 24, ' ') do |opts|
|
|
60
61
|
|
61
62
|
opts.on("-N", "--no-default-middleware",
|
62
63
|
"do not load middleware implied by RACK_ENV") do |e|
|
63
|
-
rackup_opts[:no_default_middleware] = true
|
64
|
+
rackup_opts[:no_default_middleware] = true if set_no_default_middleware
|
64
65
|
end
|
65
66
|
|
66
67
|
opts.on("-D", "--daemonize", "run daemonized in the background") do |d|
|
@@ -110,6 +111,7 @@ op = OptionParser.new("", 24, ' ') do |opts|
|
|
110
111
|
opts.parse! ARGV
|
111
112
|
end
|
112
113
|
|
114
|
+
set_no_default_middleware = false
|
113
115
|
app = Unicorn.builder(ARGV[0] || 'config.ru', op)
|
114
116
|
op = nil
|
115
117
|
|
data/bin/unicorn_rails
CHANGED
@@ -132,11 +132,11 @@ def rails_builder(ru, op, daemonize)
|
|
132
132
|
|
133
133
|
# this lambda won't run until after forking if preload_app is false
|
134
134
|
# this runs after config file reloading
|
135
|
-
lambda do
|
135
|
+
lambda do |x, server|
|
136
136
|
# Rails 3 includes a config.ru, use it if we find it after
|
137
137
|
# working_directory is bound.
|
138
138
|
::File.exist?('config.ru') and
|
139
|
-
return Unicorn.builder('config.ru', op).call
|
139
|
+
return Unicorn.builder('config.ru', op).call(x, server)
|
140
140
|
|
141
141
|
# Load Rails and (possibly) the private version of Rack it bundles.
|
142
142
|
begin
|
data/examples/big_app_gc.rb
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
# see {Unicorn::OobGC}[https://
|
1
|
+
# see {Unicorn::OobGC}[https://yhbt.net/unicorn/Unicorn/OobGC.html]
|
2
2
|
# Unicorn::OobGC was broken in Unicorn v3.3.1 - v3.6.1 and fixed in v3.6.2
|
data/examples/logrotate.conf
CHANGED
@@ -2,10 +2,10 @@
|
|
2
2
|
# /etc/logrotate.d/unicorn_app on my Debian systems
|
3
3
|
#
|
4
4
|
# See the logrotate(8) manpage for more information:
|
5
|
-
#
|
5
|
+
# https://linux.die.net/man/8/logrotate
|
6
6
|
#
|
7
7
|
# public logrotate-related discussion in our archives:
|
8
|
-
# https://
|
8
|
+
# https://yhbt.net/unicorn-public/?q=logrotate
|
9
9
|
|
10
10
|
# Modify the following glob to match the logfiles your app writes to:
|
11
11
|
/var/log/unicorn_app/*.log {
|
@@ -33,7 +33,7 @@
|
|
33
33
|
systemctl kill -s SIGUSR1 unicorn@2.service
|
34
34
|
|
35
35
|
# Examples for other process management systems appreciated
|
36
|
-
# Mail us at unicorn-public@
|
36
|
+
# Mail us at unicorn-public@yhbt.net
|
37
37
|
# (see above for archives)
|
38
38
|
|
39
39
|
# If you use a pid file and assuming your pid file
|
data/examples/nginx.conf
CHANGED
@@ -56,7 +56,8 @@ http {
|
|
56
56
|
# to configure it all in one place here for static files and also
|
57
57
|
# to disable gzip for clients who don't get gzip/deflate right.
|
58
58
|
# There are other gzip settings that may be needed used to deal with
|
59
|
-
# bad clients out there, see
|
59
|
+
# bad clients out there, see
|
60
|
+
# https://nginx.org/en/docs/http/ngx_http_gzip_module.html
|
60
61
|
gzip on;
|
61
62
|
gzip_http_version 1.0;
|
62
63
|
gzip_proxied any;
|
@@ -112,12 +113,12 @@ http {
|
|
112
113
|
# try_files directive appeared in in nginx 0.7.27 and has stabilized
|
113
114
|
# over time. Older versions of nginx (e.g. 0.6.x) requires
|
114
115
|
# "if (!-f $request_filename)" which was less efficient:
|
115
|
-
# https://
|
116
|
+
# https://yhbt.net/unicorn.git/tree/examples/nginx.conf?id=v3.3.1#n127
|
116
117
|
try_files $uri/index.html $uri.html $uri @app;
|
117
118
|
|
118
119
|
location @app {
|
119
120
|
# an HTTP header important enough to have its own Wikipedia entry:
|
120
|
-
#
|
121
|
+
# https://en.wikipedia.org/wiki/X-Forwarded-For
|
121
122
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
122
123
|
|
123
124
|
# enable this if you forward HTTPS traffic to unicorn,
|
@@ -1,9 +1,9 @@
|
|
1
1
|
# Minimal sample configuration file for Unicorn (not Rack) when used
|
2
2
|
# with daemonization (unicorn -D) started in your working directory.
|
3
3
|
#
|
4
|
-
# See https://
|
4
|
+
# See https://yhbt.net/unicorn/Unicorn/Configurator.html for complete
|
5
5
|
# documentation.
|
6
|
-
# See also https://
|
6
|
+
# See also https://yhbt.net/unicorn/examples/unicorn.conf.rb for
|
7
7
|
# a more verbose configuration using more features.
|
8
8
|
|
9
9
|
listen 2007 # by default Unicorn listens on port 8080
|
data/examples/unicorn.conf.rb
CHANGED
@@ -2,10 +2,10 @@
|
|
2
2
|
#
|
3
3
|
# This configuration file documents many features of Unicorn
|
4
4
|
# that may not be needed for some applications. See
|
5
|
-
# https://
|
5
|
+
# https://yhbt.net/unicorn/examples/unicorn.conf.minimal.rb
|
6
6
|
# for a much simpler configuration file.
|
7
7
|
#
|
8
|
-
# See https://
|
8
|
+
# See https://yhbt.net/unicorn/Unicorn/Configurator.html for complete
|
9
9
|
# documentation.
|
10
10
|
|
11
11
|
# Use at least one worker per core if you're on a dedicated server,
|
data/examples/unicorn@.service
CHANGED
@@ -14,7 +14,14 @@ After = unicorn.socket
|
|
14
14
|
# bundler users must use the "--keep-file-descriptors" switch, here:
|
15
15
|
# ExecStart = bundle exec --keep-file-descriptors unicorn -c ...
|
16
16
|
ExecStart = /usr/bin/unicorn -c /path/to/unicorn.conf.rb /path/to/config.ru
|
17
|
+
|
18
|
+
# NonBlocking MUST be true if using socket activation with unicorn.
|
19
|
+
# Otherwise, there's a small window in-between when the non-blocking
|
20
|
+
# flag is set by us and our accept4 call where systemd can momentarily
|
21
|
+
# make the socket blocking, causing us to block on accept4:
|
22
|
+
NonBlocking = true
|
17
23
|
Sockets = unicorn.socket
|
24
|
+
|
18
25
|
KillSignal = SIGQUIT
|
19
26
|
User = nobody
|
20
27
|
Group = nogroup
|
@@ -58,26 +58,44 @@ static struct common_field common_http_fields[] = {
|
|
58
58
|
|
59
59
|
#define HTTP_PREFIX "HTTP_"
|
60
60
|
#define HTTP_PREFIX_LEN (sizeof(HTTP_PREFIX) - 1)
|
61
|
+
static ID id_uminus;
|
62
|
+
|
63
|
+
/* this dedupes under Ruby 2.5+ (December 2017) */
|
64
|
+
static VALUE str_dd_freeze(VALUE str)
|
65
|
+
{
|
66
|
+
if (STR_UMINUS_DEDUPE)
|
67
|
+
return rb_funcall(str, id_uminus, 0);
|
68
|
+
|
69
|
+
/* freeze,since it speeds up older MRI slightly */
|
70
|
+
OBJ_FREEZE(str);
|
71
|
+
return str;
|
72
|
+
}
|
73
|
+
|
74
|
+
static VALUE str_new_dd_freeze(const char *ptr, long len)
|
75
|
+
{
|
76
|
+
return str_dd_freeze(rb_str_new(ptr, len));
|
77
|
+
}
|
61
78
|
|
62
79
|
/* this function is not performance-critical, called only at load time */
|
63
|
-
static void init_common_fields(
|
80
|
+
static void init_common_fields(void)
|
64
81
|
{
|
65
82
|
int i;
|
66
83
|
struct common_field *cf = common_http_fields;
|
67
84
|
char tmp[64];
|
85
|
+
|
86
|
+
id_uminus = rb_intern("-@");
|
68
87
|
memcpy(tmp, HTTP_PREFIX, HTTP_PREFIX_LEN);
|
69
88
|
|
70
89
|
for(i = ARRAY_SIZE(common_http_fields); --i >= 0; cf++) {
|
71
90
|
/* Rack doesn't like certain headers prefixed with "HTTP_" */
|
72
91
|
if (!strcmp("CONTENT_LENGTH", cf->name) ||
|
73
92
|
!strcmp("CONTENT_TYPE", cf->name)) {
|
74
|
-
cf->value =
|
93
|
+
cf->value = str_new_dd_freeze(cf->name, cf->len);
|
75
94
|
} else {
|
76
95
|
memcpy(tmp + HTTP_PREFIX_LEN, cf->name, cf->len + 1);
|
77
|
-
cf->value =
|
96
|
+
cf->value = str_new_dd_freeze(tmp, HTTP_PREFIX_LEN + cf->len);
|
78
97
|
}
|
79
|
-
|
80
|
-
rb_ary_push(mark_ary, cf->value);
|
98
|
+
rb_gc_register_mark_object(cf->value);
|
81
99
|
}
|
82
100
|
}
|
83
101
|
|
@@ -105,7 +123,7 @@ static VALUE uncommon_field(const char *field, size_t flen)
|
|
105
123
|
memcpy(RSTRING_PTR(f) + HTTP_PREFIX_LEN, field, flen);
|
106
124
|
assert(*(RSTRING_PTR(f) + RSTRING_LEN(f)) == '\0' &&
|
107
125
|
"string didn't end with \\0"); /* paranoia */
|
108
|
-
return
|
126
|
+
return HASH_ASET_DEDUPE ? f : str_dd_freeze(f);
|
109
127
|
}
|
110
128
|
|
111
129
|
#endif /* common_field_optimization_h */
|