panjf2000 / gnet

🚀 gnet is a high-performance, lightweight, non-blocking, event-driven networking framework written in pure Go.
https://gnet.host
Apache License 2.0
9.53k stars 1.03k forks source link

UDP with unique fds for each "connection" #198

Open evantandersen opened 3 years ago

evantandersen commented 3 years ago

Is your feature request related to a problem? Please describe. I have heard the linux kernel performs significantly better when using a unique socket for each UDP 'connection', because the routing data will be saved internally. (in our application, hundreds of thousands of packets sent to the same client)

Describe the solution you'd like Possible to use unique file descriptors for each UDP 'connection' inside of gnet

Describe alternatives you've considered Writing the code myself, using gnet as is (and potentially missing out on kernel performance)

Additional context I don't actually know that much about linux networking performance. Our application involves maintaining streams of data between thousands of clients, each sending ~150 packets/second. Currently using the go/net package and it's become a bottleneck. From some cursory googling and my experience from a C server I worked on a decade ago, individual FDs for UDP sockets is the way to go. Hopefully you know more!

xscode-auto-reply[bot] commented 3 years ago

Thanks for opening a new issue. The team has been notified and will review it as soon as possible. For urgent issues and priority support, visit https://xscode.com/panjf2000/gnet

panjf2000 commented 3 years ago

Investigating on it.

github-actions[bot] commented 1 day ago

This issue is marked as stale because it has been open for 30 days with no activity.

You should take one of the following actions:

This issue will be automatically closed in 7 days if no further activity occurs.