How to Tune Garbage Collector in Go Language ?
How to set the GOGC value ? You can set its value in the terminal like this.
GOGC=200 Or you can change it in yaml file of the environment variable when using docker or kubernetes.
What is the default value of GOGC ? The default value of GOGC is 100 which means that the garbage collection process will run when the allocations doubled from previous allocations count.
What can I do to reduce the effect of garbage collection in Go ? If your Go program has a large static data set, set the GOGC to a smaller percentage; for example GOGC=50.