-
Notifications
You must be signed in to change notification settings - Fork 118
More precise ack batch calculation for subscriber #5236
Description
We assume some conservative upper limit on the number of ack IDs that fit in an AcknowledgeRequest and ModifyAckDeadlineRequest. It seems that ack IDs are of variable length1. As @feywind points out, it would be more precise to measure the size of the protobuf request as we fill it, and use that to determine when a batch is full.
We would probably modify our Leases class to keep track of the to_ack / to_nack size on Leases::add(). Gemini tells me we should add 3 + ack_id.len(), because the protobuf encoding for a string takes 3 bytes. We could cut off the request size at like 500 kB, and probably fill more ack IDs in a batch than we are doing now.
This might have a slight performance bump for very high throughput applications.
Footnotes
-
maybe a function of the subscription length? ↩