Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

proposal: runtime: add total lifetime # of goroutines created #9165

Closed
gopherbot opened this issue Nov 25, 2014 · 5 comments
Closed

proposal: runtime: add total lifetime # of goroutines created #9165

gopherbot opened this issue Nov 25, 2014 · 5 comments

Comments

@gopherbot
Copy link

by dtmoore@google.com:

runtime.NumGoroutine() reports the number of live goroutines.  Can there be something
that exports the total count?

Eg, we had a process that was regularly creating/destroying more than 10,000 goroutines
a second, but the working set size is always about 3,000.  The creation rate was both
unexpected and a performance problem.  There's not currently a convenient way to extract
this information.
@ianlancetaylor
Copy link
Contributor

Comment 1:

Labels changed: added repo-main, release-none.

Status changed to Accepted.

@dvyukov
Copy link
Member

dvyukov commented Nov 26, 2014

Comment 2:

How did you find it? I assume with a CPU profiler. If so I do not see a reason to add
separate goroutine counter. First, if the goroutine creation does not show up in the CPU
profile, then it is not a problem; otherwise it's discoverable with CPU profiler.
Second, we can't add counters for all operations in runtime; CPU and memory profilers
are generic tools that uncover all issues of such kind.

@rsc rsc added this to the Unplanned milestone Apr 10, 2015
@odeke-em odeke-em changed the title runtime: add total lifetime # of goroutines created proposal: runtime: add total lifetime # of goroutines created Dec 23, 2017
@odeke-em
Copy link
Member

I've retitled this as a proposal, for what it is, to reignite the conversation and perhaps get a decision.

@odeke-em
Copy link
Member

Any Googlers able to get in touch with the original poster, as his input to @dvyukov's response might help drive the convo more.

@rsc
Copy link
Contributor

rsc commented Jan 23, 2018

I agree with @dvyukov's comment. Ordinary CPU profiling should show this, and is what people are going to reach for before printing a little-known runtime counter.

@rsc rsc closed this as completed Jan 23, 2018
@golang golang locked and limited conversation to collaborators Jan 23, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants