v0.14.0
Pre-release
Pre-release
AndreasAakesson
released this
24 Jan 09:56
·
1451 commits
to master
since this release
We’ve experienced issues with running out of memory due to lack of a way to limit speed/memory consumption in TCP. This happened when using our load balancer on links with different speed. This release mainly consists of fixes to this issue (and other issues found along the way).
What’s new:
- Our own implementation of
std::memory_resource
to be used with the C++17 concept polymorphic_allocatorPmr_pool
andPmr_resource
keep track and limits the amount of bytes an allocator can allocate.- The implementation is very flexible and let us improve and make a more sophisticated memory solution down the road
- Changed our byte vector used around the OS (mainly TCP) to use polmorphic_allocator
using buffer = std::pmr::vector<uint8_t>
- Each TCP stack now have its own assigned memory pool (
Pmr_pool
), and each TCP connection now gets assigned its own resource (Pmr_resource
)- Assigning memory to a TCP stack is done with
set_total_bufsize(const size_t size)
(default is set to 64MB)
- Assigning memory to a TCP stack is done with
- TCP connection no longer reports a static receive window, but instead a dynamic one based on how much memory used up in its resource
- This helps throttling the connection when buffers aren’t released quickly enough, and avoids buffering more than the memory limit
- Added new
on_data()
callback to TCP connection with support functionsread_next()
andnext_size()
- Triggered every time new data is ready to be read (use
read_next()
on connection to retrieve) - Solves the issue of buffering having to be implemented on top - this is now done in the connection
- Use either on_read or on_data depending on use case - as today, on_read has priority over on_data
- The same functions are now also exposed in the
net::Stream
interface
- Triggered every time new data is ready to be read (use
- New TLS stream implementation and stream buffer class
- Now utilizes the
on_data()
callback instead of on_read - Manages congestion and memory allocations for encryption better
- Now utilizes the
- Various fixes and improvements in TCP
- MicroLB hardening, improvements and fixes