passenger 5.0.0.beta2 → 5.0.0.beta3
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of passenger might be problematic. Click here for more details.
- checksums.yaml +8 -8
- checksums.yaml.gz.asc +7 -7
- data.tar.gz.asc +7 -7
- data/CHANGELOG +30 -0
- data/CONTRIBUTORS +2 -0
- data/Gemfile.lock +1 -1
- data/bin/passenger-status +13 -15
- data/build/cxx_tests.rb +14 -1
- data/build/preprocessor.rb +4 -2
- data/debian.template/control.template +2 -2
- data/doc/Security of user switching support.txt +2 -2
- data/doc/Users guide Apache.idmap.txt +6 -4
- data/doc/Users guide Apache.txt +20 -1
- data/doc/Users guide Nginx.idmap.txt +5 -3
- data/doc/Users guide Nginx.txt +22 -2
- data/ext/apache2/Configuration.cpp +6 -0
- data/ext/apache2/Configuration.hpp +4 -1
- data/ext/apache2/Hooks.cpp +1 -0
- data/ext/common/Constants.h +4 -2
- data/ext/common/Constants.h.erb +1 -1
- data/ext/common/DataStructures/LString.h +10 -0
- data/ext/common/ServerKit/Channel.h +1 -1
- data/ext/common/ServerKit/Context.h +2 -21
- data/ext/common/ServerKit/CookieUtils.h +246 -0
- data/ext/common/ServerKit/FdSourceChannel.h +10 -0
- data/ext/common/ServerKit/FileBufferedChannel.h +173 -17
- data/ext/common/ServerKit/FileBufferedFdSinkChannel.h +33 -1
- data/ext/common/ServerKit/HeaderTable.h +3 -1
- data/ext/common/ServerKit/HttpServer.h +36 -8
- data/ext/common/ServerKit/Server.h +1 -0
- data/ext/common/Utils.cpp +2 -1
- data/ext/common/Utils/DateParsing.h +15 -2
- data/ext/common/Utils/JsonUtils.h +39 -1
- data/ext/common/agents/HelperAgent/Main.cpp +4 -2
- data/ext/common/agents/HelperAgent/OptionParser.h +14 -2
- data/ext/common/agents/HelperAgent/RequestHandler.h +22 -8
- data/ext/common/agents/HelperAgent/RequestHandler/ForwardResponse.cpp +92 -11
- data/ext/common/agents/HelperAgent/RequestHandler/Hooks.cpp +3 -1
- data/ext/common/agents/HelperAgent/RequestHandler/InitRequest.cpp +9 -5
- data/ext/common/agents/HelperAgent/RequestHandler/Request.h +1 -0
- data/ext/common/agents/HelperAgent/RequestHandler/SendRequest.cpp +27 -13
- data/ext/common/agents/HelperAgent/ResponseCache.h +91 -34
- data/ext/common/agents/LoggingAgent/AdminServer.h +21 -1
- data/ext/nginx/CacheLocationConfig.c +20 -0
- data/ext/nginx/Configuration.c +130 -24
- data/ext/nginx/Configuration.h +2 -1
- data/ext/nginx/ConfigurationCommands.c +10 -0
- data/ext/nginx/ConfigurationFields.h +2 -0
- data/ext/nginx/ContentHandler.c +1 -6
- data/ext/nginx/CreateLocationConfig.c +5 -0
- data/ext/nginx/MergeLocationConfig.c +6 -0
- data/ext/nginx/StaticContentHandler.c +3 -9
- data/ext/nginx/ngx_http_passenger_module.c +2 -1
- data/ext/ruby/extconf.rb +5 -4
- data/lib/phusion_passenger.rb +2 -2
- data/lib/phusion_passenger/constants.rb +2 -1
- data/lib/phusion_passenger/nginx/config_options.rb +5 -1
- data/lib/phusion_passenger/rack/thread_handler_extension.rb +3 -1
- data/lib/phusion_passenger/ruby_core_enhancements.rb +3 -4
- data/lib/phusion_passenger/standalone/start_command.rb +5 -1
- data/lib/phusion_passenger/standalone/start_command/builtin_engine.rb +10 -3
- data/resources/templates/standalone/config.erb +2 -1
- data/test/cxx/DateParsingTest.cpp +75 -0
- data/test/cxx/ResponseCacheTest.cpp +322 -0
- data/test/cxx/ServerKit/CookieUtilsTest.cpp +274 -0
- data/test/cxx/ServerKit/HttpServerTest.cpp +77 -0
- data/test/stub/rails3.0/Gemfile.lock +2 -2
- data/test/stub/rails3.1/Gemfile.lock +2 -2
- data/test/stub/rails3.2/Gemfile.lock +2 -2
- data/test/stub/rails4.0/Gemfile.lock +2 -2
- data/test/stub/rails4.1/Gemfile.lock +2 -2
- metadata +6 -2
- metadata.gz.asc +7 -7
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZTQ0MDViNGU5MDc1Y2NiOTY1YThiMjQ3MjBlYTUwYjUxOWM0NGU5OA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
N2ZiYTc1ZTAzOGY1ZmU1YWZmODU1NDg5ZjRiNTI4ZjgyZDQyZTZlNg==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MzNiODkxN2U5ODU5ODRlYWRjOTdjYjUwZjcyNmE3NjA2NDI4ZGNlNmNhOTVi
|
10
|
+
YmZlOTdlZWI5M2E2NmU1MDBlMDhmYTQwMGMyNjJkYzI2NGMxZmJlOGZhNWVm
|
11
|
+
NDFkMWUwMTM3MDUxNGI3YWM2MGEyMzJiNTc3ZjQwYmQ2YWY2YWE=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MGQxNjFkZDJlNTY3MzFlNzg0OTg3M2FkZGQyOGM3NWFlMTEwZTE5MzNjYmNj
|
14
|
+
YzJlYzYxMjY0ZTFiY2U1NGI4NzBmMWE2NDhjMWM3YTM2YzM2NzAzYzExOWEw
|
15
|
+
ZTJiYWJmMzVkODRiYzkzNGZmYmRhZjQwYjQ3NmEzN2QxZmM0MTM=
|
checksums.yaml.gz.asc
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
|
3
3
|
Comment: GPGTools - http://gpgtools.org
|
4
4
|
|
5
|
-
|
6
|
-
|
7
|
-
/
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
=
|
5
|
+
iQEcBAABAgAGBQJU2MfxAAoJECrHRaUKISqMefAIALEqsDj8171WM+YPJkMt0Nx+
|
6
|
+
MPGtiPoLrhwO0ctDfFz+AFOTmFC4/VZMmozBC6dgHPKMhDyTcg0q9h0OvIsOncjM
|
7
|
+
eWx/V9t/9km1EeYVLY+9ZbMa2UtYFZv9PQeWSN9h3czv3O9mWNlK9WsyMEfag1xO
|
8
|
+
3+aLjce9Zb8KCwEX/CoeE/X637ZADlEUk2homyg10xwfRloOUqQQWNQrWdU1I/XR
|
9
|
+
3cjfwVQPbta+D5jJj7Ub6yXfOEZOtU5qTwFnHWelznfVo+PiFRN1wu6IBqfixZRl
|
10
|
+
ddg4MkM1ywbzoMeRsG8rKrxOosJg7u+tk5YqSYP1jiG0GwfH8VHAsIhiHnGNjw4=
|
11
|
+
=c49l
|
12
12
|
-----END PGP SIGNATURE-----
|
data.tar.gz.asc
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
|
3
3
|
Comment: GPGTools - http://gpgtools.org
|
4
4
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
=
|
5
|
+
iQEcBAABAgAGBQJU2MfxAAoJECrHRaUKISqMa4oH/11YAlJ8yVRBplmhZNqOtsZ5
|
6
|
+
glzpkrNE/2TSl82occQKHW/qZz8ay1iUOTjPrRiUkYJkgEYn7j8f3WmLUEoEjqNp
|
7
|
+
ZZX3eTEOb6/x86A5Ejr2FZqjEmqxLv3v4MdiG8rXj2Cl9iRvK0MIDSBKhckPaMj7
|
8
|
+
M+JFrJSvGWbpAuU1rilsmSK27oCrQDOYATd0U0J+muAckWkzUiTYK6XUmp894iXD
|
9
|
+
+QV4FsEe7pTptQOHZuewWtn8n+kwcrHfVP/iL4aqMJOh7LyK3KTAgFr6R4efiNL+
|
10
|
+
3O4opHc1qg8TBXMf9DUl7s43HoyY4vY5MDWKwiUzPl8Z32t1Y1h0zrlbnTtcPtY=
|
11
|
+
=2KEK
|
12
12
|
-----END PGP SIGNATURE-----
|
data/CHANGELOG
CHANGED
@@ -1,3 +1,19 @@
|
|
1
|
+
Release 5.0.0 beta 3
|
2
|
+
--------------------
|
3
|
+
|
4
|
+
* The turbocache has received major updates and fixes based on excellent feedback Chris Heald and the community. First, several bugs w.r.t. the handling of caching headers have been fixed. Second, the turbocache has become slightly more conservative for security reasons. In previous versions, default cacheable responses (as defined by RFC 7234) were cached unless caching headers tell us not to. Now, default cacheable responses are only cached if caching headers explicitly tell us to. This change was introduced because there are many applications that set incorrect caching headers on private responses. This new behavior is currently not configurable, but there are plans to make it configurable in 5.0.0 release candidate 1.
|
5
|
+
* Introduced a new configuration option, `passenger_response_buffer_high_watermark` (Nginx) and `PassengerResponseBufferHighWatermark` (Apache), for configuring the behavior of the response buffering system. Closes GH-1300.
|
6
|
+
* Fixed more cookie handling issues. Closes GH-1310.
|
7
|
+
* Fixed various WebSocket issues. Closes GH-1306.
|
8
|
+
* Fixed some crashes caused by race conditions. Closes GH-1326.
|
9
|
+
* Fixed issues with handling POST data. Closes GH-1331.
|
10
|
+
* Fixed some issues on Heroku. Closes GH-1329.
|
11
|
+
* Fixed some integer overflows. Fix contributed by Go Maeda. Closes GH-1357.
|
12
|
+
* Fixed the `passenger-status --show=union_station` command. Closes GH-1336.
|
13
|
+
* Nginx versions earlier than 1.6 are no longer supported.
|
14
|
+
* Improved state introspection.
|
15
|
+
|
16
|
+
|
1
17
|
Release 5.0.0 beta 2
|
2
18
|
--------------------
|
3
19
|
|
@@ -44,6 +60,20 @@ Minor changes:
|
|
44
60
|
* [Standalone] `passenger-standalone.json`/`Passengerfile.json` no longer overrides command line options. Instead, command line options now have the highest priority.
|
45
61
|
|
46
62
|
|
63
|
+
Release 4.0.58
|
64
|
+
--------------
|
65
|
+
|
66
|
+
* [Enterprise] Fixed a bug in the Debian packages which caused Flying Passenger to break when used with non-system Rubies.
|
67
|
+
* The Debian packages no longer require Ruby 1.9. Closes GH-1353.
|
68
|
+
|
69
|
+
|
70
|
+
Release 4.0.57
|
71
|
+
--------------
|
72
|
+
|
73
|
+
* Fixed a native extension compatibility problem with Ruby 2.2. Closes [ruby-core:67152](https://bugs.ruby-lang.org/issues/10656).
|
74
|
+
* Fixed compatibility with Nginx 1.7.9. Closes GH-1335.
|
75
|
+
|
76
|
+
|
47
77
|
Release 4.0.56
|
48
78
|
--------------
|
49
79
|
|
data/CONTRIBUTORS
CHANGED
@@ -15,6 +15,7 @@ Christoffer Sawicki
|
|
15
15
|
Damien Le Berrigaud
|
16
16
|
Dan Peterson
|
17
17
|
Danial Pearce
|
18
|
+
Daniel Knoppel (Phusion)
|
18
19
|
Dave Parfitt
|
19
20
|
David Keller
|
20
21
|
David Sissitka
|
@@ -48,6 +49,7 @@ Joshua Lund
|
|
48
49
|
jpatterson
|
49
50
|
Jude Nagurney
|
50
51
|
Luuk Hendriks (Phusion)
|
52
|
+
MAEDA Go
|
51
53
|
Magnus Holm
|
52
54
|
Michal Papis
|
53
55
|
Michał Pokrywka
|
data/Gemfile.lock
CHANGED
data/bin/passenger-status
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
# Phusion Passenger - https://www.phusionpassenger.com/
|
3
|
-
# Copyright (c) 2010-
|
3
|
+
# Copyright (c) 2010-2015 Phusion
|
4
4
|
#
|
5
5
|
# "Phusion Passenger" is a trademark of Hongli Lai & Ninh Bui.
|
6
6
|
#
|
@@ -116,7 +116,7 @@ def show_status(instance, options)
|
|
116
116
|
puts response.body
|
117
117
|
else
|
118
118
|
STDERR.puts "*** An error occured."
|
119
|
-
STDERR.puts response.body
|
119
|
+
STDERR.puts "#{response.code}: #{response.body}"
|
120
120
|
exit 2
|
121
121
|
end
|
122
122
|
|
@@ -128,7 +128,7 @@ def show_status(instance, options)
|
|
128
128
|
puts response.body
|
129
129
|
else
|
130
130
|
STDERR.puts "*** An error occured."
|
131
|
-
STDERR.puts response.body
|
131
|
+
STDERR.puts "#{response.code}: #{response.body}"
|
132
132
|
exit 2
|
133
133
|
end
|
134
134
|
|
@@ -145,7 +145,7 @@ def show_status(instance, options)
|
|
145
145
|
puts text
|
146
146
|
else
|
147
147
|
STDERR.puts "*** An error occured."
|
148
|
-
STDERR.puts response.body
|
148
|
+
STDERR.puts "#{response.code}: #{response.body}"
|
149
149
|
exit 2
|
150
150
|
end
|
151
151
|
|
@@ -163,24 +163,22 @@ def show_status(instance, options)
|
|
163
163
|
end
|
164
164
|
else
|
165
165
|
STDERR.puts "*** An error occured."
|
166
|
-
STDERR.puts response.body
|
166
|
+
STDERR.puts "#{response.code}: #{response.body}"
|
167
167
|
exit 2
|
168
168
|
end
|
169
169
|
|
170
170
|
when 'union_station'
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
171
|
+
request = Net::HTTP::Get.new("/status.txt")
|
172
|
+
request.basic_auth("ro_admin", obtain_read_only_admin_password(instance))
|
173
|
+
response = instance.http_request("agents.s/logging_admin", request)
|
174
|
+
if response.code.to_i / 100 == 2
|
175
|
+
puts response.body
|
176
|
+
else
|
177
|
+
STDERR.puts "*** An error occured."
|
178
|
+
STDERR.puts "#{response.code}: #{response.body}"
|
177
179
|
exit 2
|
178
180
|
end
|
179
|
-
|
180
|
-
puts response
|
181
181
|
end
|
182
|
-
ensure
|
183
|
-
client.close if client
|
184
182
|
end
|
185
183
|
|
186
184
|
def print_header(io, instance)
|
data/build/cxx_tests.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
# Phusion Passenger - https://www.phusionpassenger.com/
|
2
|
-
# Copyright (c) 2010-
|
2
|
+
# Copyright (c) 2010-2015 Phusion
|
3
3
|
#
|
4
4
|
# "Phusion Passenger" is a trademark of Hongli Lai & Ninh Bui.
|
5
5
|
#
|
@@ -123,6 +123,10 @@ TEST_CXX_OBJECTS = {
|
|
123
123
|
ext/common/ServerKit/HttpRequest.h
|
124
124
|
ext/common/ServerKit/HttpHeaderParser.h
|
125
125
|
ext/common/ServerKit/HttpChunkedBodyParser.h),
|
126
|
+
'test/cxx/ServerKit/CookieUtilsTest.o' => %w(
|
127
|
+
test/cxx/ServerKit/CookieUtilsTest.cpp
|
128
|
+
ext/common/ServerKit/CookieUtils.h
|
129
|
+
ext/common/DataStructures/LString.h),
|
126
130
|
'test/cxx/DataStructures/LStringTest.o' => %w(
|
127
131
|
test/cxx/DataStructures/LStringTest.cpp
|
128
132
|
ext/common/DataStructures/LString.h),
|
@@ -141,6 +145,12 @@ TEST_CXX_OBJECTS = {
|
|
141
145
|
'test/cxx/DechunkerTest.o' => %w(
|
142
146
|
test/cxx/DechunkerTest.cpp
|
143
147
|
ext/common/Utils/Dechunker.h),
|
148
|
+
'test/cxx/ResponseCacheTest.o' => %w(
|
149
|
+
test/cxx/ResponseCacheTest.cpp
|
150
|
+
ext/common/agents/HelperAgent/ResponseCache.h
|
151
|
+
ext/common/agents/HelperAgent/RequestHandler/Request.h
|
152
|
+
ext/common/agents/HelperAgent/RequestHandler/AppResponse.h
|
153
|
+
ext/common/ServerKit/HttpRequest.h),
|
144
154
|
'test/cxx/UnionStationTest.o' => %w(
|
145
155
|
test/cxx/UnionStationTest.cpp
|
146
156
|
ext/common/agents/LoggingAgent/LoggingServer.h
|
@@ -227,6 +237,9 @@ TEST_CXX_OBJECTS = {
|
|
227
237
|
'test/cxx/ProcessMetricsCollectorTest.o' => %w(
|
228
238
|
test/cxx/ProcessMetricsCollectorTest.cpp
|
229
239
|
ext/common/Utils/ProcessMetricsCollector.h),
|
240
|
+
'test/cxx/DateParsingTest.o' => %w(
|
241
|
+
test/cxx/DateParsingTest.cpp
|
242
|
+
ext/common/Utils/DateParsing.h),
|
230
243
|
'test/cxx/UtilsTest.o' => %w(
|
231
244
|
test/cxx/UtilsTest.cpp
|
232
245
|
ext/common/Utils.h),
|
data/build/preprocessor.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
# Phusion Passenger - https://www.phusionpassenger.com/
|
3
|
-
# Copyright (c) 2013 Phusion
|
3
|
+
# Copyright (c) 2013-2015 Phusion
|
4
4
|
#
|
5
5
|
# "Phusion Passenger" is a trademark of Hongli Lai & Ninh Bui.
|
6
6
|
#
|
@@ -182,7 +182,9 @@ private
|
|
182
182
|
"quantal" => "12.10",
|
183
183
|
"raring" => "13.04",
|
184
184
|
"saucy" => "13.10",
|
185
|
-
"trusty" => "14.04"
|
185
|
+
"trusty" => "14.04",
|
186
|
+
"utopic" => "14.10",
|
187
|
+
"vivid" => "15.05"
|
186
188
|
}
|
187
189
|
DEBIAN_DISTRIBUTIONS = {
|
188
190
|
"squeeze" => "20110206",
|
@@ -28,8 +28,8 @@ XS-Ruby-Versions: all
|
|
28
28
|
Package: passenger
|
29
29
|
Architecture: any
|
30
30
|
Depends: ${shlibs:Depends}, ${misc:Depends},
|
31
|
-
ruby2.2 | ruby2.1 | ruby2.0 | ruby1.9.1 | ruby1.8 | ruby-interpreter,
|
32
|
-
rubygems1.9.1 | rubygems1.9 | rubygems (>= 1.2),
|
31
|
+
ruby2.4 | ruby2.3 | ruby2.2 | ruby2.1 | ruby2.0 | ruby1.9.1 | ruby1.8 | ruby-interpreter,
|
32
|
+
rubygems-integration (>= 1.8) | rubygems1.9.1 | rubygems1.9 | rubygems (>= 1.2),
|
33
33
|
#if is_distribution?('<= lucid') || is_distribution?('<= squeeze')
|
34
34
|
librack-ruby,
|
35
35
|
#else
|
@@ -64,7 +64,7 @@ If the answer is yes, then we cannot use this method.
|
|
64
64
|
|
65
65
|
The advantage of this method is that setting up Apache to run as root is
|
66
66
|
incredibly easy, and requires no new framework to be written. However, testing
|
67
|
-
this method in automated unit tests will require running the unit test
|
67
|
+
this method in automated unit tests will require running the unit test suite as
|
68
68
|
root.
|
69
69
|
|
70
70
|
Using Apache's suEXEC
|
@@ -190,7 +190,7 @@ implemented. We rely on the system administrator to set the correct owner
|
|
190
190
|
on that file.
|
191
191
|
|
192
192
|
We have also not implemented suEXEC's security model. suEXEC's model is quite
|
193
|
-
paranoid, and although paranoia is good to a certain
|
193
|
+
paranoid, and although paranoia is good to a certain extent, it can be in the
|
194
194
|
way of usability while proving little extra security. We are not entirely
|
195
195
|
convinced that implementing suEXEC's full security model will provide
|
196
196
|
significant benefits, but if you have good reasons to think otherwise, please
|
@@ -210,13 +210,15 @@
|
|
210
210
|
|
211
211
|
7.7.2. PassengerBufferResponse <on|off> => passengerbufferresponse-on-off--1y7ilka
|
212
212
|
|
213
|
-
7.7.3.
|
213
|
+
7.7.3. PassengerResponseBufferHighWatermark <bytes> => passengerresponsebufferhighwatermark-bytes--1kj32df
|
214
214
|
|
215
|
-
7.7.4.
|
215
|
+
7.7.4. PassengerErrorOverride <on|off> => passengererroroverride-on-off--1pq9nez
|
216
216
|
|
217
|
-
7.7.5.
|
217
|
+
7.7.5. PassengerMaxRequestQueueSize <number> => passenger-max-request-queue-size-number--1f1uocd
|
218
218
|
|
219
|
-
7.7.6.
|
219
|
+
7.7.6. PassengerStickySessions <on|off> => passengerstickysessions-on-off--fx1jkt
|
220
|
+
|
221
|
+
7.7.7. PassengerStickySessionsCookieName => passenger-sticky-sessions-cookie-name-stktkx
|
220
222
|
|
221
223
|
7.8. Compatibility options => compatibility-options-8jve5a
|
222
224
|
|
data/doc/Users guide Apache.txt
CHANGED
@@ -1794,7 +1794,7 @@ happen in memory.
|
|
1794
1794
|
Before we proceed with explaining this configuration option, we want to state the following to avoid confusion. If you use Phusion Passenger for Apache, there are in fact two response buffering systems active:
|
1795
1795
|
|
1796
1796
|
1. The Apache response buffering system. `PassengerBufferResponse` turns this on or off.
|
1797
|
-
2. The Phusion Passenger response buffering system, a.k.a. 'real-time disk-backed response buffering'. This buffering system is always on, regardless of the value of `PassengerBufferResponse
|
1797
|
+
2. The Phusion Passenger response buffering system, a.k.a. 'real-time disk-backed response buffering'. This buffering system is always on, regardless of the value of `PassengerBufferResponse`, but its behavior can be tweaked with <<PassengerResponseBufferHighWatermark,PassengerResponseBufferHighWatermark>>.
|
1798
1798
|
|
1799
1799
|
Response buffering is useful because it protects against slow HTTP clients that do not read responses immediately or quickly enough. Buffering prevents such slow clients from blocking web applications that have limited concurrency. Because Phusion Passenger's response buffering is always turned on, you are always protected. Therefore, `PassengerBufferResponse` is off by default, and you never should have to turn it on.
|
1800
1800
|
|
@@ -1864,6 +1864,25 @@ The <<PassengerBufferResponse,PassengerBufferResponse>> directive should be turn
|
|
1864
1864
|
if responses can be huge. Because entire responses are buffered in memory when turned on.
|
1865
1865
|
=====================================================
|
1866
1866
|
|
1867
|
+
[[PassengerResponseBufferHighWatermark]]
|
1868
|
+
==== PassengerResponseBufferHighWatermark <bytes>
|
1869
|
+
:version: 5.0.0
|
1870
|
+
include::users_guide_snippets/since_version.txt[]
|
1871
|
+
|
1872
|
+
As explained in <<passenger_buffer_response,PassengerBufferResponse>>, Phusion Passenger has two response buffering mechanisms. This option configures the maximum size of the real-time disk-backed response buffering system. If the buffer is full, the application will be blocked until the client has fully read the buffer.
|
1873
|
+
|
1874
|
+
This buffering system has a default size of *128 MB* (134217728 bytes). This default value is large enough to prevent most applications from blocking on slow clients, but small enough to prevent broken applications from filling up the hard disk.
|
1875
|
+
|
1876
|
+
You can't disable real-time disk-backed response buffering, but you can set the buffer size to a small value, which is effectively the same as disabling it.
|
1877
|
+
|
1878
|
+
Most of the time, you won't need to tweak this value. But there is one good use case where you may want set this option to a low value: if you are streaming a large response, but want to detect client disconnections as soon as possible. If the buffer size is larger than your response size, then Phusion Passenger will read and buffer the response as fast as it can, offloading the application as soon as it can, thereby preventing the application from detecting client disconnects. But if the buffer size is sufficiently small (say, 64 KB), then your application will effectively output response data at the same speed as the client reads it, allowing you to detect client disconnects almost immediately. This is also a down side, because many slow clients blocking your application can result in a denial of service, so use this option with care.
|
1879
|
+
|
1880
|
+
If your application outputs responses larger than 128 MB and you are not interested in detecting client disconnects as soon as possible, then you should raise this value, or set it to 0.
|
1881
|
+
|
1882
|
+
A value of 0 means that the buffer size is unlimited.
|
1883
|
+
|
1884
|
+
This option may only occur once, in the global server configuration. The default value is '134217728' (128 MB).
|
1885
|
+
|
1867
1886
|
[[PassengerErrorOverride]]
|
1868
1887
|
==== PassengerErrorOverride <on|off> ====
|
1869
1888
|
:version: 4.0.24
|
@@ -232,11 +232,13 @@
|
|
232
232
|
|
233
233
|
7.6.12. passenger_buffer_response <on|off> => passenger-buffer-response
|
234
234
|
|
235
|
-
7.6.13.
|
235
|
+
7.6.13. passenger_response_buffer_high_watermark <bytes> => passenger-response-buffer-high-watermark-bytes--ranajv
|
236
236
|
|
237
|
-
7.6.14.
|
237
|
+
7.6.14. passenger_buffer_size => passenger-buffer-size-1jfkq87
|
238
238
|
|
239
|
-
7.6.15.
|
239
|
+
7.6.15. passenger_buffers => passenger-busy-buffers
|
240
|
+
|
241
|
+
7.6.16. passenger_busy_buffer_size => passenger-busy-buffer-size-124sj61
|
240
242
|
|
241
243
|
7.7. Logging and debugging options => logging-and-debugging-options-14e91ni
|
242
244
|
|
data/doc/Users guide Nginx.txt
CHANGED
@@ -1891,6 +1891,7 @@ This option may occur in the following places:
|
|
1891
1891
|
|
1892
1892
|
In each place, it may be specified at most once. The default value is '512'.
|
1893
1893
|
|
1894
|
+
[[passenger_buffer_response]]
|
1894
1895
|
==== passenger_buffer_response <on|off> ====
|
1895
1896
|
When turned on, application-generated responses are buffered by Nginx. Buffering will
|
1896
1897
|
happen in memory and also on disk if the response is larger than a certain threshold.
|
@@ -1898,7 +1899,7 @@ happen in memory and also on disk if the response is larger than a certain thres
|
|
1898
1899
|
Before we proceed with explaining this configuration option, we want to state the following to avoid confusion. If you use Phusion Passenger for Nginx, there are in fact two response buffering systems active:
|
1899
1900
|
|
1900
1901
|
1. The Nginx response buffering system. `passenger_buffer_response` turns this on or off.
|
1901
|
-
2. The Phusion Passenger response buffering system, a.k.a. 'real-time disk-backed response buffering'. This buffering system is always on, regardless of the value of `passenger_buffer_response
|
1902
|
+
2. The Phusion Passenger response buffering system, a.k.a. 'real-time disk-backed response buffering'. This buffering system is always on, regardless of the value of `passenger_buffer_response`, but its behavior can be tweaked with <<PassengerResponseBufferHighWatermark,passenger_response_buffer_high_watermark>>.
|
1902
1903
|
|
1903
1904
|
Response buffering is useful because it protects against slow HTTP clients that do not read responses immediately or quickly enough. Buffering prevents such slow clients from blocking web applications that have limited concurrency. Because Phusion Passenger's response buffering is always turned on, you are always protected. Therefore, `passenger_buffer_response` is off by default, and you never should have to turn it on.
|
1904
1905
|
|
@@ -1961,10 +1962,29 @@ This option may occur in the following places:
|
|
1961
1962
|
|
1962
1963
|
In each place, it may be specified at most once. The default value is 'off'.
|
1963
1964
|
|
1965
|
+
[[PassengerResponseBufferHighWatermark]]
|
1966
|
+
==== passenger_response_buffer_high_watermark <bytes>
|
1967
|
+
:version: 5.0.0
|
1968
|
+
include::users_guide_snippets/since_version.txt[]
|
1969
|
+
|
1970
|
+
As explained in <<passenger_buffer_response,passenger_buffer_response>>, Phusion Passenger has two response buffering mechanisms. This option configures the maximum size of the real-time disk-backed response buffering system. If the buffer is full, the application will be blocked until the client has fully read the buffer.
|
1971
|
+
|
1972
|
+
This buffering system has a default size of *128 MB* (134217728 bytes). This default value is large enough to prevent most applications from blocking on slow clients, but small enough to prevent broken applications from filling up the hard disk.
|
1973
|
+
|
1974
|
+
You can't disable real-time disk-backed response buffering, but you can set the buffer size to a small value, which is effectively the same as disabling it.
|
1975
|
+
|
1976
|
+
Most of the time, you won't need to tweak this value. But there is one good use case where you may want set this option to a low value: if you are streaming a large response, but want to detect client disconnections as soon as possible. If the buffer size is larger than your response size, then Phusion Passenger will read and buffer the response as fast as it can, offloading the application as soon as it can, thereby preventing the application from detecting client disconnects. But if the buffer size is sufficiently small (say, 64 KB), then your application will effectively output response data at the same speed as the client reads it, allowing you to detect client disconnects almost immediately. This is also a down side, because many slow clients blocking your application can result in a denial of service, so use this option with care.
|
1977
|
+
|
1978
|
+
If your application outputs responses larger than 128 MB and you are not interested in detecting client disconnects as soon as possible, then you should raise this value, or set it to 0.
|
1979
|
+
|
1980
|
+
A value of 0 means that the buffer size is unlimited.
|
1981
|
+
|
1982
|
+
This option may only occur once, in the 'http' configuration block. The default value is '134217728' (128 MB).
|
1983
|
+
|
1964
1984
|
==== passenger_buffer_size ====
|
1965
1985
|
==== passenger_buffers ====
|
1966
1986
|
==== passenger_busy_buffer_size ====
|
1967
|
-
These options have the same effect as
|
1987
|
+
These options have the same effect as ngx_http_proxy_module's similarly named options.
|
1968
1988
|
They can be used to modify the maximum allowed HTTP header size.
|
1969
1989
|
|
1970
1990
|
|
@@ -238,6 +238,7 @@ DEFINE_SERVER_INT_CONFIG_SETTER(cmd_passenger_log_level, logLevel, unsigned int,
|
|
238
238
|
DEFINE_SERVER_STR_CONFIG_SETTER(cmd_passenger_debug_log_file, debugLogFile)
|
239
239
|
DEFINE_SERVER_INT_CONFIG_SETTER(cmd_passenger_max_pool_size, maxPoolSize, unsigned int, 1)
|
240
240
|
DEFINE_SERVER_INT_CONFIG_SETTER(cmd_passenger_pool_idle_time, poolIdleTime, unsigned int, 0)
|
241
|
+
DEFINE_SERVER_INT_CONFIG_SETTER(cmd_passenger_response_buffer_high_watermark, responseBufferHighWatermark, unsigned int, 0)
|
241
242
|
DEFINE_SERVER_INT_CONFIG_SETTER(cmd_passenger_stat_throttle_rate, statThrottleRate, unsigned int, 0)
|
242
243
|
DEFINE_SERVER_BOOLEAN_CONFIG_SETTER(cmd_passenger_user_switching, userSwitching)
|
243
244
|
DEFINE_SERVER_STR_CONFIG_SETTER(cmd_passenger_default_user, defaultUser)
|
@@ -410,6 +411,11 @@ const command_rec passenger_commands[] = {
|
|
410
411
|
NULL,
|
411
412
|
RSRC_CONF,
|
412
413
|
"The maximum number of seconds that an application may be idle before it gets terminated."),
|
414
|
+
AP_INIT_TAKE1("PassengerResponseBufferHighWatermark",
|
415
|
+
(Take1Func) cmd_passenger_response_buffer_high_watermark,
|
416
|
+
NULL,
|
417
|
+
RSRC_CONF,
|
418
|
+
"The maximum size of the response buffer."),
|
413
419
|
AP_INIT_FLAG("PassengerUserSwitching",
|
414
420
|
(FlagFunc) cmd_passenger_user_switching,
|
415
421
|
NULL,
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/*
|
2
2
|
* Phusion Passenger - https://www.phusionpassenger.com/
|
3
|
-
* Copyright (c) 2010-
|
3
|
+
* Copyright (c) 2010-2015 Phusion
|
4
4
|
*
|
5
5
|
* "Phusion Passenger" is a trademark of Hongli Lai & Ninh Bui.
|
6
6
|
*
|
@@ -187,6 +187,8 @@ struct ServerConfig {
|
|
187
187
|
* idle before it gets terminated. */
|
188
188
|
unsigned int poolIdleTime;
|
189
189
|
|
190
|
+
unsigned int responseBufferHighWatermark;
|
191
|
+
|
190
192
|
unsigned int statThrottleRate;
|
191
193
|
|
192
194
|
/** Whether user switching support is enabled. */
|
@@ -220,6 +222,7 @@ struct ServerConfig {
|
|
220
222
|
debugLogFile = NULL;
|
221
223
|
maxPoolSize = DEFAULT_MAX_POOL_SIZE;
|
222
224
|
poolIdleTime = DEFAULT_POOL_IDLE_TIME;
|
225
|
+
responseBufferHighWatermark = DEFAULT_RESPONSE_BUFFER_HIGH_WATERMARK;
|
223
226
|
statThrottleRate = DEFAULT_STAT_THROTTLE_RATE;
|
224
227
|
userSwitching = true;
|
225
228
|
defaultUser = DEFAULT_WEB_APP_USER;
|