-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
rcmgr: Add conn_limiter to limit number of conns per ip cidr #2788
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just had a quick glance so far.
connLimitPerCIDRIP4 []ConnLimitPerCIDR | ||
connLimitPerCIDRIP6 []ConnLimitPerCIDR | ||
ip4connsPerLimit []map[string]int | ||
ip6connsPerLimit []map[string]int |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this a slice? How are these maps ever garbage collected?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It’s a slice because the limits are a slice. Each map corresponds to each limit.
You’re right about the gc of course, I need to delete after removing all conns from a subnet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we add an exception for no limits on localhost so that tests don't break?
Are there any tests that currently break? |
I think they're fine. |
This change makes the resource manager aware of IPs. Adds some reasonable defaults too.