From 50c6a5fb07c873fd5c9ae3fb6294e0b11c689de2 Mon Sep 17 00:00:00 2001 From: Ethan Mosbaugh Date: Wed, 12 Jun 2019 13:48:36 -0700 Subject: [PATCH] Fix rate limiting for logger, increase refill rate Signed-off-by: Ethan Mosbaugh --- daemon/cluster/executor/container/controller.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/daemon/cluster/executor/container/controller.go b/daemon/cluster/executor/container/controller.go index dd50a36ff4..4ef22490fc 100644 --- a/daemon/cluster/executor/container/controller.go +++ b/daemon/cluster/executor/container/controller.go @@ -508,7 +508,9 @@ func (r *controller) Logs(ctx context.Context, publisher exec.LogPublisher, opti var ( // use a rate limiter to keep things under control but also provides some // 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{ NodeID: r.task.NodeID, ServiceID: r.task.ServiceID,