From 6482d746ab8b7e3d09b31ad621e5b8f9264cf878 Mon Sep 17 00:00:00 2001 From: Jonathan Moody <103143855+moodyjon@users.noreply.github.com> Date: Tue, 24 May 2022 08:56:24 -0400 Subject: [PATCH] Allow environment var GOGC= to override hard-coded SetGCPercent(10). --- lbcd.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lbcd.go b/lbcd.go index 1110eeab..b9606653 100644 --- a/lbcd.go +++ b/lbcd.go @@ -281,7 +281,9 @@ func main() { // limits the garbage collector from excessively overallocating during // bursts. This value was arrived at with the help of profiling live // usage. - debug.SetGCPercent(10) + if _, ok := os.LookupEnv("GOGC"); !ok { + debug.SetGCPercent(10) + } // Up some limits. if err := limits.SetLimits(); err != nil { -- 2.45.2