Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
net: mass connection spike leads to unpredictable amount of memory usage #35407
A spike in TCP connections can lead to spike in memory usage in TCP handlers (for example http.ServeHTTP), which leads to unpredictable memory usage. The same happens for UDP servers.
Example projects, that have this behavior:
Known cases when this can happen:
While investigating a problem with connection spikes, that caused an oom kill of our http proxy skipper, I tried to understand the underlying issue.
I could reproduce a DoS kind of situation with minimal Go code running in docker containers.
Below I will show how to create spikes that are not manageable with unbounded number of goroutines.
What version of Go are you using (
@bradfitz you proposed to eliminate goroutines for idle connections: