Repository navigation
0.16.0
Highlights
Faster
- A connection keeps the heap its last request needed as its floor, so the next request starts at that size instead of growing it again through several garbage collections. Handlers that build sizeable responses, such as JSON, served about 23% more requests on HTTP/1.1, and pipelined requests about 22% more. The floor is learned again every 16 requests and dropped before a connection hibernates, so a connection whose requests got smaller gives the memory back (#495)
- HTTP/2 and HTTP/3 stream workers start at the floor their connection learned from earlier streams: a JSON load over h2c served about 27% more requests with the same peak memory (#496)
- A WebSocket session keeps a floor learned from its
handle_info/2calls, where server pushes are built: a session pushing a 50-item JSON message collected once per push instead of five times, and a push took about 44 µs instead of 73 µs. Inbound frames run no extra code (#497)
New
handler_spawn => #{heap_floor => #{max => Words}}sets the most heap a connection keeps as its floor, default46422(about 360 KB);heap_floor => falseturns it off (#495, #499)ws => #{heap_floor => #{max => Words, min => Words}}tunes the floor for WebSocket sessions: its cap (by defaulthandler_spawn's) and the least heap ahandle_info/2must have needed to raise it (default2586, about 20 KB);falseturns it off. An upgrade can set the same for its own session (#497, #499)
Upgrading from 0.15
- The heap floor is on by default: a busy connection that serves sizeable responses holds a larger heap between requests (about 10% more memory under a JSON load). Set
handler_spawn => #{heap_floor => false}for the old behavior (#495, #496, #497)
What's Changed
- Keep the heap a request needed as the connection's floor by @williamthome in #495
- Keep a heap floor for HTTP/2 and HTTP/3 stream workers by @williamthome in #496
- Keep a heap floor for WebSocket pushes built in handle_info by @williamthome in #497
- Test the heap floor of HTTP/3 stream workers by @williamthome in #498
- Shape the heap floor options like roadrunner's other features by @williamthome in #499
Full Changelog: 0.15.0...0.16.0