The SO_REUSEPORT socket option
The SO_REUSEPORT socket option
Posted Mar 15, 2013 16:51 UTC (Fri) by giraffedata (guest, #1954)In reply to: The SO_REUSEPORT socket option by jezuch
Parent article: The SO_REUSEPORT socket option
I guess it was not feasible to fix "multiple servers accept() on the same socket" to distribute connections more evenly?
"Incoming connections and datagrams are distributed to the server sockets using a hash based on the 4-tuple of the connection—that is, the peer IP address and port plus the local IP address and port."
That probably explains it. If you used this technique on multiple threads accepting on the same traditional socket, you would be fixing one thing and breaking another. Today, if a thread is blocked in accept() and no other thread is, and a connection request arrives, the thread gets it. It sounds like with a SO_REUSEPORT socket, the connection request would wait until its predetermined accepter is ready to take it.
