Cowboy 2.8 contains many optimizations for all protocols. HTTP/1.1 has received the largest improvements and Cowboy will now be able to handle noticeably more requests. Thanks to the folks at Stressgrid for helping identify that the performance was lower than it should have been and for benchmarking my many changes and experiments.
Cowboy 2.8 also contains a small number of tweaks and bug fixes. Cowboy 2.8 is the first Cowboy release, ever, to be consistently green on all tested platforms. This is mostly due to the reworking of some test cases, but a few bugs were discovered and fixed in the process.
Cowboy 2.8 requires Erlang/OTP 22.0 or greater. It may also work out of the box with Erlang/OTP 21.3 but this was not tested and is not supported.
active,onceto receive data from the socket. This greatly improves the performance and allows Cowboy to process more requests, especially for HTTP/1.1. The
active_nprotocol option can be configured to change the
active,Nvalue. The default is 100 for all protocols.
linger_timeoutoption for HTTP/2. The default is 1000, or one second. This helps ensure that the final GOAWAY frame will be properly received by clients.
cowboy_req:parse_header/2,3will now parse the headers
protocolsprotocol option allows configuring which protocol will be used for clear listeners. Setting it to
[http2]will disable HTTP/1.1 entirely. This feature will be extended in a future release.
max_keepaliveoption has been increased. It now allows 1000 requests before gracefully closing the connection.
max_received_frame_rateoption has been increased. It now allows 10000 frames every 10 seconds.
cowboy_req:reply/4with a status code of 204 or 304 and a non-empty response body will now result in a crash. Using
cowboy_req:stream_reply/2,3with 204 or 304 and then attempting to send a body will also result in a crash. These status codes disallow response bodies and trying to send one will break HTTP/1.1 framing.
cowboy_compress_hstream handler will now ignore malformed accept-encoding headers instead of crashing.
cowboy:start_tls(3)now mentions that some protocol options may be documented in the releevant stream handler.
cowboy_req:parse_header(3)was corrected. When an unsupported header is given the function crashes, it does not return an
Donate to Loïc Hoguin because his work on Cowboy, Ranch, Gun and Erlang.mk is fantastic:
Recurring payment options are also available via GitHub Sponsors. These funds are used to cover the recurring expenses like food, dedicated servers or domain names.