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

Enable SO_REUSEPORT #464

Merged
merged 2 commits into from
Jul 2, 2024
Merged

Enable SO_REUSEPORT #464

merged 2 commits into from
Jul 2, 2024

Conversation

netixx
Copy link
Contributor

@netixx netixx commented Apr 15, 2024

Enable SO_REUSEPORT on the TCP socket,

This enables multiple instances of the BGP server to be started on the same machine, binding to the same TCP port.

The kernel will load-balance the incoming connections to all listening instances.
Instances that have the correct BGP peers configured will take the connection,
and those who don't will reject it, letting another instance have a try when the router restarts the connection.

Signed-off-by: netixx <[email protected]>
@taktv6
Copy link
Member

taktv6 commented Apr 18, 2024

Thanks for contributing. LGTM in general. But I think we should make this configurable to avoid confusion for those who accidentally start multiple instances they didn't intent to.

@netixx netixx force-pushed the enable-reuseport branch from 16dd0a6 to e9d95a5 Compare April 18, 2024 12:11
@netixx netixx force-pushed the enable-reuseport branch from e9d95a5 to e3dea28 Compare April 18, 2024 12:16
@netixx
Copy link
Contributor Author

netixx commented Apr 18, 2024

ok, I added an option on the BGP server itself.

Maybe it would be better to push a list of options in the ListenAddrsPerVRF, so that we could set that per listener, but that is breaking change in terms of API.

(
Instead of map[string][]string we would need a

map[string]struct{
listenAddr []string
reusePort bool
}

)

Let me know if you would prefer that option :)

Copy link
Member

@taktv6 taktv6 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@taktv6 taktv6 merged commit 63eef2b into bio-routing:master Jul 2, 2024
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants