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

Commit

Permalink
fix: disable ratelimiter's slack
Browse files Browse the repository at this point in the history
'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.
  • Loading branch information
0x2E committed Jul 13, 2023
1 parent ad2b06f commit cd7990b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/engine/resolver.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ func (e *Engine) resolver(wg *sync.WaitGroup) {
}()

go func() {
rl := ratelimit.New(conf.C.Rate)
rl := ratelimit.New(conf.C.Rate, ratelimit.WithoutSlack)
for t := range e.toResolver {
if _, ok := taskMap.Load(t.DomainName); ok {
continue
Expand Down

0 comments on commit cd7990b

Please sign in to comment.