BlogsCloudflareGo Garbage Collection Tuning

Go Garbage Collection Tuning

Go Garbage Collection Tuning

2
posts
2015–2017

Cloudflare's engineering blog has explored various aspects of Go programming, including performance optimization and debugging. This post details an investigation into the performance impact of Go's garbage collector (GC) on multi-core machines. The author benchmarks ECDSA P256 signing operations across different numbers of goroutines, observing a performance drop with increasing goroutines due to frequent and expensive GC cycles. The post demonstrates how tuning the GOGC variable, which control

2017

Go, don't collect my garbage

11/13/2017

This post details an investigation into the performance impact of Go's garbage collector (GC) on multi-core machines. The author benchmarks ECDSA P256 signing operations across different numbers of goroutines, observing a performance drop with increasing goroutines due to frequent and expensive GC cycles. The post demonstrates how tuning the GOGC variable, which controls the GC target percentage, can significantly improve performance by reducing GC frequency. Disabling the GC entirely (`GOGC=off`) yields the highest throughput, but tuning GOGC to an optimal value (e.g., 11,300) provides a substantial performance boost while maintaining a sustainable GC strategy. This highlights the importance of understanding and tuning GC behavior for performance-critical applications on multi-core systems.

2015

Quick and dirty annotations for Go stack traces

8/3/2015

This post introduces a technique for improving the debuggability of Go stack traces by converting IPv4 addresses to their uint32 representation and passing them as blank identifier parameters to goroutine functions. This allows for easier identification of listening IPs within stack traces, especially in high-concurrency environments like Cloudflare's RRDNS server.