Skip to content

cmd/pprof, runtime/pprof: add stack size profiler #20010

Closed
@valyala

Description

@valyala

Programs that run millions of concurrent goroutines (i.e. busy web servers, game servers, rpc servers) are usually sensitive to the amount of memory occupied by goroutines' stacks.

For instance, we currently have a web service running up to a million of concurrent goroutines per physical machine. It eats up to 4Gb of stack per machine and it is OK. But when we tried enabling gzip compression the first time, we immediately hit #18625 , that increased per-machine stack usage to more than 40Gb. We couldn't quickly figure out who ate the stack, so resorted to a hack instead of fixing the issue in the compress/flate package.

It would be great to have stack size profiler, which could show stack traces that led to the peak stack usage, so stack hogs could be easily detected and fixed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    FeatureRequestIssues asking for a new feature that does not need a proposal.FrozenDueToAge

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions