Skip to content
This repository was archived by the owner on Oct 13, 2023. It is now read-only.

Commit a6e499a

Browse files
authored
Merge pull request #40628 from cpuguy83/19.03_backport_39360_swarm_log_fill_rate
[19.03] Fix rate limiting for logger, increase refill rate Upstream-commit: d12b6d24d1ec69abd14c1476b581219f40bb8f1d Component: engine
2 parents b4c5804 + 6bf8bed commit a6e499a

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

components/engine/daemon/cluster/executor/container/controller.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,9 @@ func (r *controller) Logs(ctx context.Context, publisher exec.LogPublisher, opti
508508
var (
509509
// use a rate limiter to keep things under control but also provides some
510510
// ability coalesce messages.
511-
limiter = rate.NewLimiter(rate.Every(time.Second), 10<<20) // 10 MB/s
511+
// this will implement a "token bucket" of size 10 MB, initially full and refilled
512+
// at rate 10 MB tokens per second.
513+
limiter = rate.NewLimiter(10<<20, 10<<20) // 10 MB/s
512514
msgctx = api.LogContext{
513515
NodeID: r.task.NodeID,
514516
ServiceID: r.task.ServiceID,

0 commit comments

Comments
 (0)