Skip to content
This repository has been archived by the owner on Feb 20, 2023. It is now read-only.

Replication message overhead, especially for ACK. #1636

Open
lmwnshn opened this issue Aug 19, 2021 · 6 comments
Open

Replication message overhead, especially for ACK. #1636

lmwnshn opened this issue Aug 19, 2021 · 6 comments
Labels
performance Performance related issues or changes.

Comments

@lmwnshn
Copy link
Contributor

lmwnshn commented Aug 19, 2021

The message payload is a very small fraction of the overall message.

Here's an example of an ACK:
image

It is not as bad, but still somewhat bad, for lengthier messages such as TXN_APPLIED. Note that we could theoretically Huffman encode the keys or whatever and significantly shrink the message size, which brings us back to the ACK case:

image

To fix this, we should examine batching messages, or maintaining a channel to send small messages over.

@lmwnshn lmwnshn added the performance Performance related issues or changes. label Aug 19, 2021
@lmwnshn
Copy link
Contributor Author

lmwnshn commented Aug 19, 2021

A quick counter of pending_messages_.size() suggests that batching would be quite profitable.

https://github.com/cmu-db/noisepage/blob/master/src/messenger/messenger.cpp#L526

@jkosh44
Copy link
Contributor

jkosh44 commented Aug 19, 2021

In terms of reading these pictures which number is the payload and which is the overall message size?

I thinking switching to a smaller data serialization format like protobuf would probably help with individual message size, which is something I'd like to try next semester.

@lmwnshn
Copy link
Contributor Author

lmwnshn commented Aug 19, 2021

@jkosh44 First line, Frame blabla: N bytes on wire is the total frame size
Our payload is the last line, Data (N bytes)

@lmwnshn
Copy link
Contributor Author

lmwnshn commented Aug 19, 2021

A quick thought is maybe you can just introduce a new BatchedMessage message type, which is interpreted by the receiver as many individual little messages. But a complication is that we do not separate out pending_messages_ by recipient right now.

@jkosh44
Copy link
Contributor

jkosh44 commented Aug 19, 2021

Ahh ok, I think I misunderstood then. So the non-data bytes are things like TCP headers? In that case protobuf would reduce payload/non-payload ratio but not help with non-payload data per message.

I like the idea of a BatchedMessage type.

One option would be for the ReplicationManager to be responsible for batching and unbatching messages, so it just hands a single batched message to the Messenger, which can treat it like any other message. That way we don't need to separate out pending_messages_ by recipient. However no other clients of the Messenger would benefit from batched messages.

Though I don't think separating pending_messages_ out by recipient would be too hard. Also it could allow us to do some cool things in the future like see if certain recipients are more backed up than others.

@lmwnshn
Copy link
Contributor Author

lmwnshn commented Aug 19, 2021

A separate optimization is that we can assume messages are not lost by default, which means that we don't need to ACK the majority of messages.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
performance Performance related issues or changes.
Projects
None yet
Development

No branches or pull requests

2 participants