| 1 |
[appendix] |
| 2 |
== Migrating from Cowboy 2.7 to 2.8 |
| 3 |
|
| 4 |
Cowboy 2.8 contains many optimizations for all |
| 5 |
protocols. HTTP/1.1 has received the largest |
| 6 |
improvements and Cowboy will now be able to |
| 7 |
handle noticeably more requests. Thanks to |
| 8 |
the folks at Stressgrid for helping identify that |
| 9 |
the performance was lower than it should have been |
| 10 |
and for benchmarking my many changes and experiments. |
| 11 |
|
| 12 |
Cowboy 2.8 also contains a small number of tweaks |
| 13 |
and bug fixes. Cowboy 2.8 is the first Cowboy release, |
| 14 |
ever, to be consistently green on all tested platforms. |
| 15 |
This is mostly due to the reworking of some test cases, |
| 16 |
but a few bugs were discovered and fixed in the process. |
| 17 |
|
| 18 |
Cowboy 2.8 requires Erlang/OTP 22.0 or greater. It may |
| 19 |
also work out of the box with Erlang/OTP 21.3 but this |
| 20 |
was not tested and is not supported. |
| 21 |
|
| 22 |
=== Features added |
| 23 |
|
| 24 |
* Cowboy will now use `active,N` instead of `active,once` |
| 25 |
to receive data from the socket. This greatly improves |
| 26 |
the performance and allows Cowboy to process more |
| 27 |
requests, especially for HTTP/1.1. The `active_n` |
| 28 |
protocol option can be configured to change the |
| 29 |
`active,N` value. The default is 100 for all protocols. |
| 30 |
|
| 31 |
* Add a `linger_timeout` option for HTTP/2. The default |
| 32 |
is 1000, or one second. This helps ensure that the |
| 33 |
final GOAWAY frame will be properly received by clients. |
| 34 |
|
| 35 |
* The function `cowboy_req:parse_header/2,3` will now |
| 36 |
parse the headers `access-control-request-headers`, |
| 37 |
`access-control-request-method`, `content-encoding`, |
| 38 |
`content-language`, `max-forwards`, `origin`, |
| 39 |
`proxy-authorization` and `trailer`. |
| 40 |
|
| 41 |
* A Performance chapter has been added to the guide. |
| 42 |
More content will be added in future releases. |
| 43 |
|
| 44 |
* Update Cowlib to 2.9.1. |
| 45 |
|
| 46 |
=== Experimental features added |
| 47 |
|
| 48 |
* A `protocols` protocol option allows configuring which |
| 49 |
protocol will be used for clear listeners. Setting it |
| 50 |
to `[http2]` will disable HTTP/1.1 entirely. This feature |
| 51 |
will be extended in a future release. |
| 52 |
|
| 53 |
=== Features modified |
| 54 |
|
| 55 |
* The default value for HTTP/1.1's `max_keepalive` option |
| 56 |
has been increased. It now allows 1000 requests before |
| 57 |
gracefully closing the connection. |
| 58 |
|
| 59 |
* The default value for HTTP/2's `max_received_frame_rate` |
| 60 |
option has been increased. It now allows 10000 frames every |
| 61 |
10 seconds. |
| 62 |
|
| 63 |
* Cowboy will now accept whitespace in cookie names. This |
| 64 |
is in line with the recommended parsing algorithm for the |
| 65 |
upcoming cookie RFC update, and corresponds to what browsers |
| 66 |
are doing. |
| 67 |
|
| 68 |
=== Bugs fixed |
| 69 |
|
| 70 |
* The number of Transport:send/2 calls has been optimized |
| 71 |
for HTTP/2. Reducing the number of calls has a noticeable |
| 72 |
impact on the number of requests that can be processed. |
| 73 |
|
| 74 |
* Trying to use `cowboy_req:reply/4` with a status code of |
| 75 |
204 or 304 and a non-empty response body will now result |
| 76 |
in a crash. Using `cowboy_req:stream_reply/2,3` with 204 |
| 77 |
or 304 and then attempting to send a body will also result |
| 78 |
in a crash. These status codes disallow response bodies |
| 79 |
and trying to send one will break HTTP/1.1 framing. |
| 80 |
|
| 81 |
* A crash has been fixed related to HTTP/1.1 pipelining. |
| 82 |
The bug was most likely introduced in Cowboy 2.6 when |
| 83 |
flow control was added for HTTP/1.1 request bodies. |
| 84 |
|
| 85 |
* The HTTP/1.1 protocol code could get stuck because of flow |
| 86 |
control. This has been corrected. |
| 87 |
|
| 88 |
* A crash has been fixed for HTTP/1.1. It occurred when |
| 89 |
a flow control update was requested (such as reading |
| 90 |
the request body) after the body was fully read. |
| 91 |
|
| 92 |
* The timeout was incorrectly reset sometimes when a stream |
| 93 |
(a pair of request/response) terminated. This has been |
| 94 |
corrected. |
| 95 |
|
| 96 |
* Handling of hibernation for Websocket has been improved. |
| 97 |
Websocket over HTTP/2 now supports hibernating. Stray |
| 98 |
messages no longer cancel hibernation. |
| 99 |
|
| 100 |
* The `cowboy_compress_h` stream handler will now ignore |
| 101 |
malformed accept-encoding headers instead of crashing. |
| 102 |
|
| 103 |
* The manual pages for `cowboy:start_clear(3)` and |
| 104 |
`cowboy:start_tls(3)` now mentions that some protocol |
| 105 |
options may be documented in the releevant stream |
| 106 |
handler. |
| 107 |
|
| 108 |
* The manual page for `cowboy_req:parse_header(3)` was |
| 109 |
corrected. When an unsupported header is given the |
| 110 |
function crashes, it does not return an `undefined` tuple. |
| 111 |
|
| 112 |
* The routing algorithm description in the user guide has |
| 113 |
been improved. |
| 114 |
|
| 115 |
* The test suites are now consistently green on all tested |
| 116 |
platforms. Most of the test failures were caused by flaky |
| 117 |
tests. Avoiding the use of timeouts fixed most of them. |
| 118 |
A small number of tests had to be reworked. |