perf(peer): Increase buffer threshold and adjust backpressure timing

Co-authored-by: qtozdec <56160254+qtozdec@users.noreply.github.com>
This commit is contained in:
zarazaex69
2026-04-10 14:56:39 +03:00
parent a758b6fb2d
commit 76ae387a04

View File

@@ -725,15 +725,15 @@ func (p *Peer) processSendQueue(workerID int) {
start := time.Now()
for p.dc.BufferedAmount() > 16*1024 {
time.Sleep(5 * time.Millisecond)
if time.Since(start) > 5*time.Second {
for p.dc.BufferedAmount() > 4*1024*1024 {
time.Sleep(10 * time.Millisecond)
if time.Since(start) > 10*time.Second {
log.Printf("[WORKER-%d] Buffer wait timeout, dropping packet size=%d", workerID, len(data))
break
}
}
if time.Since(start) > 5*time.Second {
if time.Since(start) > 10*time.Second {
continue
}