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

net: add support for collective TCP listeners #6890

Closed
mikioh opened this issue Dec 4, 2013 · 10 comments

Comments

Projects
None yet
4 participants
@mikioh
Copy link
Contributor

commented Dec 4, 2013

Latest Linux and DragonFly BSD kernel support this feature. 

The SO_REUSEPORT socket option
https://lwn.net/Articles/542629/

Also see
torvalds/linux@c617f39
and
http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/740d1d9f7b7bf9c9c021abb8197718d7a2d441c9
for the detail.
@mikioh

This comment has been minimized.

Copy link
Contributor Author

commented Dec 4, 2013

Comment 1:

Some experiment:
https://golang.org/cl/34580043/
@mikioh

This comment has been minimized.

Copy link
Contributor Author

commented Dec 4, 2013

Comment 2:

Labels changed: added repo-main, release-none.

@mikioh

This comment has been minimized.

Copy link
Contributor Author

commented Dec 4, 2013

Comment 4:

Status changed to Thinking.

@mikioh

This comment has been minimized.

Copy link
Contributor Author

commented Dec 6, 2013

@gopherbot

This comment has been minimized.

Copy link

commented Mar 5, 2014

Comment 6 by elazarl:

Instead of chasing the kernel, and implementing various options the kernel adds, I think
it's better to add a callback to Dial, that would let you use setsockopt on the socket
fd/handle before using it.
Something along the lines of
    Dialer{Callback: func (fd uintptr) { syscalls.Setsockopts(SO_BINDTOADDR, fd) }}.Dial(...)
@mikioh

This comment has been minimized.

Copy link
Contributor Author

commented Mar 5, 2014

Comment 7:

I don't understand #6. This feature is for endpoints on the passive open side, not
related to Dial.
@gopherbot

This comment has been minimized.

Copy link

commented Mar 5, 2014

Comment 8 by elazarl:

I meant that we can add a general setsockopts options, to set socket options before the
net package handle them. And while we at it, we can add this option to dial to.
This way, you don't have to do anything special for SO_REUSEPORT.
@mikioh

This comment has been minimized.

Copy link
Contributor Author

commented Mar 5, 2014

Comment 9:

Please open a new issue for your purpose. This issue is focused on "collective TCP
listeners", also not stick to SO_REUSEPORT or other option because probably on FreeBSD,
the way using shared tcpcb and inpcbgrup inside the kernel would be a different kernel
API.
@kavu

This comment has been minimized.

Copy link
Contributor

commented Mar 21, 2014

Comment 11:

To whom It may concern: I have implemented similar feature as separate package
https://github.com/kavu/go_reuseport. I'll be glad if you'll find it useful, and I may
improve it further and submit it as a patch if you wish.
@mikioh

This comment has been minimized.

Copy link
Contributor Author

commented Mar 8, 2017

I'll merge this issue into #9661.

@mikioh mikioh closed this Mar 8, 2017

@golang golang locked and limited conversation to collaborators Mar 8, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.