openziti / dilithium

Framework for high-performance streaming over message-passing systems. High-performance WAN protocols over UDP datagrams. Implemented in golang.
Apache License 2.0
13 stars 2 forks source link

rxPortalSz -> txPortal Capacity Pressure #95

Closed michaelquigley closed 3 years ago

michaelquigley commented 4 years ago

See the attached image. To prevent these retx "cascades", let's experiment with using rxPortalSz (possibly scaled by a factor) to reduce the link capacity.

We're currently looking at the available capacity as the minimum capacity - sz for both txPortalSz and rxPortalSz... and rxPortalSz is nearly always 0 unless we're already in a non-optimal state. Instead, we can probably scale the available capacity as:

capacity - (txPortalSz - (rxPortalSz * rxPortalSzScale))

This should allow quicker clamping of tx flow, possibly smoothing out those cascades.

michaelquigley commented 4 years ago

rxPortalSz

michaelquigley commented 4 years ago

Pressure factor 2x: rxPortalSz-pressure-factor-2x

michaelquigley commented 4 years ago
txCapacity := float64(self.capacity-int(float64(self.rxPortalSz)*self.profile.TxPortalRxSzPressureScale)-(self.txPortalSz+segmentSz))
rxCapacity := float64(self.capacity-self.rxPortalSz)
for math.Min(txCapacity, rxCapacity) < 0 {
    self.ready.Wait()
}

TxPortalRxSzPressureScale currently defaulting to 2.5.

michaelquigley commented 4 years ago

3x: factor-3x