Merge pull request #39360 from emosbaugh/logging-rate-limiter-bucket-fix
Fix rate limiting for logger, increase refill rate
This commit is contained in:
commit
c2deb9f97f
1 changed files with 3 additions and 1 deletions
|
@ -508,7 +508,9 @@ func (r *controller) Logs(ctx context.Context, publisher exec.LogPublisher, opti
|
||||||
var (
|
var (
|
||||||
// use a rate limiter to keep things under control but also provides some
|
// use a rate limiter to keep things under control but also provides some
|
||||||
// ability coalesce messages.
|
// ability coalesce messages.
|
||||||
limiter = rate.NewLimiter(rate.Every(time.Second), 10<<20) // 10 MB/s
|
// this will implement a "token bucket" of size 10 MB, initially full and refilled
|
||||||
|
// at rate 10 MB tokens per second.
|
||||||
|
limiter = rate.NewLimiter(10<<20, 10<<20) // 10 MB/s
|
||||||
msgctx = api.LogContext{
|
msgctx = api.LogContext{
|
||||||
NodeID: r.task.NodeID,
|
NodeID: r.task.NodeID,
|
||||||
ServiceID: r.task.ServiceID,
|
ServiceID: r.task.ServiceID,
|
||||||
|
|
Loading…
Reference in a new issue