Skip to content

perf: quantify network space overhead #18919

@petermattis

Description

@petermattis

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-kv-clientRelating to the KV client and the KV interface.A-kv-replicationRelating to Raft, consensus, and coordination.C-performancePerf of queries or internals. Solution not expected to change functional behavior.T-kvKV TeamX-staleno-issue-activity

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions