From ac8bc77688be47113620bf406dfb8009f2ffdfe6 Mon Sep 17 00:00:00 2001 From: Aliaksandr Valialkin Date: Tue, 31 Jan 2023 10:55:31 -0800 Subject: [PATCH] lib/bytesutil/internstring.go: increase the limit on the maximum string lengths, which can be interned The limit has been increased from 300 bytes to 500 bytes according to the collected production stats. This allows reducing CPU usage without significant increase of RAM usage in most practical cases. Updates https://github.com/VictoriaMetrics/VictoriaMetrics/issues/3692 --- lib/bytesutil/internstring.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/bytesutil/internstring.go b/lib/bytesutil/internstring.go index cfb652e5e..600758c8a 100644 --- a/lib/bytesutil/internstring.go +++ b/lib/bytesutil/internstring.go @@ -9,7 +9,7 @@ import ( "github.com/VictoriaMetrics/VictoriaMetrics/lib/fasttime" ) -var internStringMaxLen = flag.Int("internStringMaxLen", 300, "The maximum length for strings to intern. Lower limit may save memory at the cost of higher CPU usage. "+ +var internStringMaxLen = flag.Int("internStringMaxLen", 500, "The maximum length for strings to intern. Lower limit may save memory at the cost of higher CPU usage. "+ "See https://en.wikipedia.org/wiki/String_interning") // InternBytes interns b as a string