Skip to content

How to evaluate the etcd value size #16450

Closed Answered by ahrtr
lance5890 asked this question in Q&A
Discussion options

You must be logged in to vote

I just wonder if or not the value size have been compacted when restored in etcd boltdb

bbolt doesn't compact the value. But the key & value stored in bbolt is different from the key & value what users see. The key stored in bbolt is actually a monotonically increasing revision, and the value stored in bbolt includes both the real key & value users see. Please read kvstore_txn.go#L209-L232

If you really want to get the value size programatically, you should use the etcd SDK (call the Get method), and then get the value size using expression something like len(resp.Kvs[0].Value).

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@lance5890
Comment options

@jmhbnz
Comment options

@ahrtr
Comment options

Answer selected by lance5890
@lance5890
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants