Skip to content
This repository was archived by the owner on Jan 22, 2025. It is now read-only.

Coalesce packets better #4456

Merged
merged 1 commit into from
May 29, 2019

Conversation

sakridge
Copy link
Contributor

Problem

packet receiver creates lots of hardly-used packets buffers. This causes poor banking and forwarding performance because there are too many small batches in the pipeline.

Summary of Changes

Coalesce packets from streamer better.

Fixes #

@sakridge sakridge requested review from pgarg66 and rob-solana May 28, 2019 21:55
@codecov
Copy link

codecov bot commented May 28, 2019

Codecov Report

Merging #4456 into master will increase coverage by 1.8%.
The diff coverage is 77.7%.

@@           Coverage Diff            @@
##           master   #4456     +/-   ##
========================================
+ Coverage    76.7%   78.5%   +1.8%     
========================================
  Files         176     176             
  Lines       32363   31683    -680     
========================================
+ Hits        24823   24874     +51     
+ Misses       7540    6809    -731

@codecov
Copy link

codecov bot commented May 28, 2019

Codecov Report

Merging #4456 into master will decrease coverage by 2.4%.
The diff coverage is 95.2%.

@@           Coverage Diff            @@
##           master   #4456     +/-   ##
========================================
- Coverage      79%   76.5%   -2.5%     
========================================
  Files         176     177      +1     
  Lines       31245   32311   +1066     
========================================
+ Hits        24707   24746     +39     
- Misses       6538    7565   +1027

@@ -238,7 +242,7 @@ impl Packets {
}
trace!("got {} packets", npkts);
i += npkts;
if npkts != NUM_RCVMMSGS || i >= 1024 {
Copy link
Contributor

@rob-solana rob-solana May 29, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This check for NUM_RCVMMSGS is important, it's a signal that there's nothing there now. Do you propose we poll for a full millisecond instead?

Copy link
Contributor Author

@sakridge sakridge May 29, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, if the buffer is not full (1k limit is not hit). This early exit creates a lot of really small packet buffers which clog up the banking stage. Small batch performance is much worse than larger batches. I think it's better to take the latency hit early in the pipeline to allow them to clear faster later in the pipeline.

@sakridge sakridge force-pushed the coalesce-packets-better branch from bf8a444 to 08f72d6 Compare May 29, 2019 17:46
@sakridge sakridge force-pushed the coalesce-packets-better branch from 08f72d6 to afa188a Compare May 29, 2019 17:52
@sakridge sakridge merged commit 4404634 into solana-labs:master May 29, 2019
@sakridge sakridge deleted the coalesce-packets-better branch May 29, 2019 19:17
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants