Developer Platform von Cloudflare
K2 - Lower latency and higher throughput for K2 Consume
Consume requests that return records now have 41% to 49% lower latency across percentiles, with median latency down from 1.19 seconds to 0.63 seconds. Subscriptions catching up on a backlog see 71% lower median latency and consume about 170% more batches per hour.
Each Consume first finds where in the stream its batch starts, then reads the records. We optimized this seek phase, so K2 starts reading records sooner.
p95 latency of K2 Consume requests that return records, dropping by about half after the change
The following table shows the latency of Consume requests that return records:
Percentile
Before
After
Change
Median
1.19 s
0.63 s
47% lower
p90
2.41 s
1.28 s
47% lower
p95
2.73 s
1.39 s
49% lower
p99
3.43 s
2.01 s
41% lower
The following table shows the latency of all Consume requests, including polls that return no new records:
Percentile
Before
After
Change
p95
1.03 s
0.85 s
18% lower
p99
2.26 s
1.31 s
42% lower
Subscriptions that are far behind the newest records see the largest reduction. Their median Consume latency dropped from 2.0 seconds to 0.6 seconds, so they catch up on a backlog sooner.
You do not need to change anything to get these improvements. They apply to every subscription and to the existing Consume API.