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

Goroutine spike when closing connections in v1.8.10 (regression) #434

Closed
ash2k opened this issue Feb 19, 2024 · 3 comments
Closed

Goroutine spike when closing connections in v1.8.10 (regression) #434

ash2k opened this issue Feb 19, 2024 · 3 comments
Labels
Milestone

Comments

@ash2k
Copy link

ash2k commented Feb 19, 2024

When we bumped the library from v1.8.7 to v1.8.10 we started seeing huge memory usage spikes when the process is shutting down. It turned out to be because the library starts lots of goroutines in some (?) case.

Blue graph is RAM usage in percentage of max allowed. Note how spikes start at some point - that's when the version with the library update was rolled out.
Screenshot_2023-12-14_at_9 32 10_pm

Screenshot from Google Profiler with the width of the flame graph showing the proportion of goroutines with a certain stacktrace. Note that at the moment of capture there was 153,983 goroutines, most of them from the library.

Screenshot_2024-02-13_at_7 13 48_am

This is a regression. Code worked fine until the version bump and works fine again since we downgraded the library.

Original issue: https://gitlab.com/gitlab-org/cluster-integration/gitlab-agent/-/issues/492

@nhooyr nhooyr added the bug label Feb 19, 2024
@nhooyr
Copy link
Contributor

nhooyr commented Feb 19, 2024

Related #429

Terrible code here on my part, will need to rewrite the close code to fix. Will try and do soon.

nhooyr added a commit to alixander/websocket that referenced this issue Apr 5, 2024
Far simpler now. Sorry this took a while.

Closes coder#427
Closes coder#429
Closes coder#434
Closes coder#436
Closes coder#437
@nhooyr
Copy link
Contributor

nhooyr commented Apr 5, 2024

Thanks for reporting. I've fixed this in #427. Please review and let me know if you see anything else.

nhooyr added a commit to alixander/websocket that referenced this issue Apr 5, 2024
Far simpler now. Sorry this took a while.

Closes coder#427
Closes coder#429
Closes coder#434
Closes coder#436
Closes coder#437
@nhooyr nhooyr added this to the v1.8.11 milestone Apr 5, 2024
@nhooyr
Copy link
Contributor

nhooyr commented Apr 7, 2024

Sorry for the delay. Fixed by #427.

@nhooyr nhooyr closed this as completed Apr 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants