tutorials
tutorials copied to clipboard
Lesson 211 - Improvements for Caddy
For a more fair comparison, you should set the GOGC environment variable to off to disable Go's garbage collector. Stress tests and benchmarks will trigger a lot of collections that will occur very differently (when the server is idle on the happy path) when handling real-life traffic, which tends to distort comparisons (it's also possible to change the ratio instead).
If you're using containers with a small amount of available memory, you should also GOMEMLIMIT, this can dramatically improve performance.
More info:
- https://pkg.go.dev/runtime#hdr-Environment_Variables
- https://blog.cloudflare.com/go-dont-collect-my-garbage/
- https://weaviate.io/blog/gomemlimit-a-game-changer-for-high-memory-applications
Thank you! I'll try it out, actually i deploy both on VMs, using m7a.large instances.