Loading…
Topic
TCP
2 posts about TCP. Every summary links to the original.
- 2 posts
- 1 company
The Good Stuff
Paid picks we use ourselves. Links carry a referral code — a subscription through one earns us a commission at no extra cost to you.
Newest first
Posts
Introducing the (blazing fast!) native TCP client for .NET
ClickHouse has released an experimental native TCP client for .NET, available in the ClickHouse.Driver package. Unlike the HTTP client, which requires two format conversions between column blocks and rows, the TCP client uses the native protocol to transfer data as column blocks, enabling zero-allocation, zero-copy reads and writes. In benchmarks, this achieves 1.5-2x faster speeds, over 99% fewer GC allocations, streamed reads of 1.1 million rows per second (115 million values), and parallel inserts at 877,000 rows per second (832,000 from POCOs), all on modest hardware. The client supports three API tiers—column streaming for maximum performance, POCO mapping with compiled per-column loops, and object arrays—and includes a migration path from HTTP. However, it remains experimental, lacking ADO.NET, binary JSON, JWT authentication, and alternative formats, and it only runs on .NET 8 or later.
Chasing that 32 ms tail latency in ClickHouse
A customer observed an extra ~32 ms tail latency on simple SELECT queries after idle periods in ClickHouse’s Native TCP protocol. The root cause was that after a TCP idle period (RTO), the congestion window resets to initcwnd (8 MSS), and with TCP_NODELAY enabled, each metadata packet (ProfileEvents, Logs, Progress) becomes a separate TCP segment, exceeding the small window and forcing an additional round trip. The ClickHouse Native protocol sends these metadata packets between Data and EndOfStream, and the unbatched writes caused the problem. The team reproduced the issue deterministically using Linux network namespaces and tc to simulate 32 ms RTT and initcwnd 8. They fixed it by batching those metadata packets into a single buffer write at the application layer, reducing tail latency from ~32 ms to ~1 ms, as confirmed by a Go client program that measured the time between the last Data packet and EndOfStream.
Related topics
All topics →Weekly digest
The best engineering reads, once a week.