mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2026-05-17 08:36:55 +03:00
lib/cgroup: set GOGC to 50 by default if it isn't set
This should reduce memory usage for typical VictoriaMetrics workloads by up to 50%
This commit is contained in:
@@ -51,6 +51,7 @@ func writePrometheusMetrics(w io.Writer) {
|
||||
fmt.Fprintf(w, "vm_allowed_memory_bytes %d\n", memory.Allowed())
|
||||
fmt.Fprintf(w, "vm_available_memory_bytes %d\n", memory.Allowed()+memory.Remaining())
|
||||
fmt.Fprintf(w, "vm_available_cpu_cores %d\n", cgroup.AvailableCPUs())
|
||||
fmt.Fprintf(w, "vm_gogc %d\n", cgroup.GetGOGC())
|
||||
|
||||
// Export start time and uptime in seconds
|
||||
fmt.Fprintf(w, "vm_app_start_timestamp %d\n", startTime.Unix())
|
||||
|
||||
Reference in New Issue
Block a user