Menu

1 / 2

Why Your Go Microservice Spends 40% of CPU on runtime.mallocgc

DEV Community·Gabriel Anhaia·6 months ago
#HqDkdXIi
#culprit#go#performance#benchmark#string
Reading 0:00
15s threshold

Book: The Complete Guide to Go Programming

Also by me: Thinking in Go (2-book series) — Complete Guide to Go Programming + Hexagonal Architecture in Go

My project: Hermes IDE | GitHub — an IDE for developers who ship with Claude Code and other AI coding tools

Me: xgabriel.com | GitHub

You open a CPU profile from a Go service that has been running fine for a year. The team finally got around to looking because the autoscaler is adding pods faster than traffic is growing. The flame graph loads. You squint at the top of it and the picture is the same picture you have seen on three other Go services this quarter.

The numbers below are a representative pattern. The percentages come from a synthetic profile assembled to illustrate the shape, not a captured trace from one named production service.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.