-
Notifications
You must be signed in to change notification settings - Fork 4.1k
perf: quantify network space overhead #18919
Description
Similar to #18659 I decided to look at the overhead in Batch{Request,Response} for simple "kv" reads (i.e. a single Scan{Request,Response} in the batch).
BatchRequest: 191
BatchRequest.Header: 156
BatchRequest.Header.Txn: 122
BatchRequest.Requests[0]: 30
BatchResponse: 189
BatchResponse.Header: 138
BatchResponse.Header.Txn: 122
BatchResponse.Responses[0]: 46
The Scan{Request,Response} consume exactly 20% of the total bytes sent/received. The request and response txn consume 64% of the bytes. The response txn is nearly identical to the request txn with only Transaction.MaxTimestamp having changed.
There are some small gains to be had by converting Batch{Request,Response}, Transaction and TxnMeta to proto3 to avoid encoding zero value primitive fields. There is a large gain to be had by only returning the delta of the transaction in the response.
Cc @andreimatei who suggested last week that we develop a more principled way to update the transaction upon receiving a response.