Skip to content
This repository was archived by the owner on Aug 29, 2024. It is now read-only.

Commit cd7990b

Browse files
committed
fix: disable ratelimiter's slack
'Slack allows the limiter to accumulate "unspent" requests for future bursts of traffic.' It can cause a large number of packets to be 'sent' suddenly after running for a while, resulting in a large number of packet losses. This can be observed in the send/recv stats log.
1 parent ad2b06f commit cd7990b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

internal/engine/resolver.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ func (e *Engine) resolver(wg *sync.WaitGroup) {
6969
}()
7070

7171
go func() {
72-
rl := ratelimit.New(conf.C.Rate)
72+
rl := ratelimit.New(conf.C.Rate, ratelimit.WithoutSlack)
7373
for t := range e.toResolver {
7474
if _, ok := taskMap.Load(t.DomainName); ok {
7575
continue

0 commit comments

Comments
 (0)