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

Commit 6bf8bed

Browse files
emosbaughcpuguy83
authored andcommitted
Fix rate limiting for logger, increase refill rate
Signed-off-by: Ethan Mosbaugh <ethan@replicated.com> (cherry picked from commit 50c6a5fb07c873fd5c9ae3fb6294e0b11c689de2) Signed-off-by: Brian Goff <cpuguy83@gmail.com> Upstream-commit: e6c9e2736f5d522491fe5283029edbc166a37d2a Component: engine
1 parent 8d20869 commit 6bf8bed

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)