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
Possible goroutine leak #153
Comments
We have created an issue in Pivotal Tracker to manage this: https://www.pivotaltracker.com/story/show/167596191 The labels on this github issue will be updated when the story is started. |
I have attached a dump from one of the servers (curl http://127.0.0.1:17002/debug/pprof/goroutine?debug=2 > /tmp/dump.out) This is from one of our production envs where we have had the gorouter running for 22days. This is not our largest env as in an even larger env we see 400K goroutines in the metric. This is bad enough with over 50K. Perhaps you can see what is "stuck" or point us to how this could be happening and if it is normal. |
We looked at the dump and saw tons of this block:
This function is used in websockets. Do you expect many long lived websocket connections on your platform? |
Yes in this environment we do have many websockets. But it is very much over the number of established websockets. I can look at the metrics and give you an idea of how many we have as perhaps there is an issue with closing these out when the socket closes. |
We believe we've narrowed down the issue. We were able to reproduce this behavior by pushing a slow websocket server such that the Goroute would time out the request with a The bug is here:
When that timeout occurs the
We're working on a fix since we definitely shouldn't be leaking goroutines like this, but I'm curious to know if you're seeing any performance implications from this in your environments? I'd imagine higher memory usage... are you also seeing higher CPU usage on your gorouters? Thanks, |
We didn't see a lot of problems. but we saw this in the metrics and in theory could be a problem in the future. It is also a problem when diagnosing issues with so many threads and trying to debug a problem that could be occuring. In fact the gorouter is usually working well and this has very little impact except for some extra memory usage. |
Good to know! 👍 We pushed a commit that should resolve the goroutine leak and are currently working on refactoring this code a bit in general. |
Thanks for submitting an issue to
routing-release
. We are always trying to improve! To help us, please fill out the following template.Issue
Seeing on the gorouter.numGoRoutines grow over time to even as high as 400K goroutines. We need to know if this is an issue and what is getting "stuck"?
Context
using 0.188.0
Steps to Reproduce
Unsure.
Expected result
A steady state of number of goroutines not growing linearly
Current result
Nothing seems to be an issue but could become one depending on how long the gorouter is running.
Possible Fix
name of issue
Output ResultsI will see how I can attach a stack dump performed on one of the gorouters.
The text was updated successfully, but these errors were encountered: