Skip to content

0.16.0

Choose a tag to compare

@williamthome williamthome released this 12 Nov 13:47
· 130 commits to main since this release
04d1d62

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/2 calls, 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, default 46422 (about 360 KB); heap_floor => false turns it off (#495, #499)
  • ws => #{heap_floor => #{max => Words, min => Words}} tunes the floor for WebSocket sessions: its cap (by default handler_spawn's) and the least heap a handle_info/2 must have needed to raise it (default 2586, about 20 KB); false turns 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

Full Changelog: 0.15.0...0.16.0