1
0
mirror of https://github.com/facebookincubator/mvfst.git synced 2025-08-08 09:42:06 +03:00

Experiment with longer timer compensation in Quic Pacer

Summary:
Our current timer compenstation works as following:

Pacer schedule write -> Pacer marks scheduled time T0-> timer fires -> Pacer uses (now - T0 + writeInterval) to calculate burst size -> transport writes burst size amount of data at time T1 -> pacer schedules again.

This diff changes to:

Pacer scheduleWrite -> timer fires -> Pacer uses (now - previous T1' + writeInteral) to calculate burst size -> transport writes burst size amount of data at T1 -> pacer schedules again

because T1' < T0 < T1, this compensates the timer more.

With higher compensation from timer interval calculation, the `tokens_ += batchSize_;` code inside refreshPacingRate is removed in this diff.

Reviewed By: yangchi

Differential Revision: D22532672

fbshipit-source-id: 6547298e933965ab412d944cfd65d5c60f4dced7
This commit is contained in:
Yang Chi
2020-07-29 16:53:09 -07:00
committed by Facebook GitHub Bot
parent 018ff668ad
commit 8b007886df
7 changed files with 23 additions and 57 deletions

View File

@@ -2943,7 +2943,6 @@ TEST_F(QuicTransportTest, AlreadyScheduledPacingNoWrite) {
EXPECT_CALL(*socket_, write(_, _)).WillOnce(Return(0));
EXPECT_CALL(*rawPacer, updateAndGetWriteBatchSize(_))
.WillRepeatedly(Return(1));
EXPECT_CALL(*rawPacer, onPacedWriteScheduled(_));
EXPECT_CALL(*rawPacer, getTimeUntilNextWrite())
.WillRepeatedly(Return(3600000ms));
// This will write out 100 bytes, leave 100 bytes behind. FunctionLooper will