aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2019-09-13 14:20:04 +0200
committerLoïc Hoguin <[email protected]>2019-09-14 18:21:05 +0200
commit49af57d546b5e2fd5aaa9fcd43d09060b9682c5a (patch)
treea59b73e1039fe33081491bf2a55621a7d2563356 /doc
parent4427108b69fcd1e6a8233a217fa0e99d0564b714 (diff)
downloadcowboy-49af57d546b5e2fd5aaa9fcd43d09060b9682c5a.tar.gz
cowboy-49af57d546b5e2fd5aaa9fcd43d09060b9682c5a.tar.bz2
cowboy-49af57d546b5e2fd5aaa9fcd43d09060b9682c5a.zip
Implement backpressure on cowboy_req:stream_body
This should limit the amount of memory that Cowboy is using when a handler is sending data much faster than the network. The new max_stream_buffer_size is a soft limit and only has an effect when the cowboy_stream_h handler is used.
Diffstat (limited to 'doc')
-rw-r--r--doc/src/manual/cowboy_http2.asciidoc11
1 files changed, 10 insertions, 1 deletions
diff --git a/doc/src/manual/cowboy_http2.asciidoc b/doc/src/manual/cowboy_http2.asciidoc
index 19271d4..e899289 100644
--- a/doc/src/manual/cowboy_http2.asciidoc
+++ b/doc/src/manual/cowboy_http2.asciidoc
@@ -31,6 +31,7 @@ opts() :: #{
max_encode_table_size => non_neg_integer(),
max_frame_size_received => 16384..16777215,
max_frame_size_sent => 16384..16777215 | infinity,
+ max_stream_buffer_size => non_neg_integer(),
max_stream_window_size => 0..16#7fffffff,
preface_timeout => timeout(),
proxy_header => boolean(),
@@ -136,6 +137,12 @@ following the client's advertised maximum.
Note that actual frame sizes may be lower than the limit when
there is not enough space left in the flow control window.
+max_stream_buffer_size (8000000)::
+
+Maximum stream buffer size in bytes. This is a soft limit used
+to apply backpressure to handlers that send data faster than
+the HTTP/2 connection allows.
+
max_stream_window_size (16#7fffffff)::
Maximum stream window size in bytes. This is used as an upper bound
@@ -186,7 +193,9 @@ too many `WINDOW_UPDATE` frames.
`max_connection_window_size`, `max_stream_window_size`,
`stream_window_margin_size` and
`stream_window_update_threshold` to configure
- behavior on sending WINDOW_UPDATE frames.
+ behavior on sending WINDOW_UPDATE frames, and
+ `max_stream_buffer_size` to apply backpressure
+ when sending data too fast.
* *2.6*: The `proxy_header` and `sendfile` options were added.
* *2.4*: Add the options `initial_connection_window_size`,
`initial_stream_window_size`, `max_concurrent_streams`,