UlricE / pen

Pen
Other
250 stars 41 forks source link

UDP loadbalancing fails with EADDRINUSE #36

Open mozeq opened 7 years ago

mozeq commented 7 years ago

Hi, I was playing with PEN as one of the option for udp loadbalancing and ran into a problem with the latest release. It seems like it's trying to repeatedly bind the listening address:port for every client, but it's failing with EADDRINSUSE. My wild guess is that it fails because my system uses older kernel (pre 3.2) and doesn't support the SO_REUSEPORT.

UlricE commented 7 years ago

That can be correct. Pen 0.33 and forward "connects" the downstream socket so that a multi-frame UDP "stream" will be treated as such and not as a bunch of individual frames.

My first suggestion would be to update the kernel, SO_REUSEPORT has been available for a number of years now.

Otherwise, Pen before 0.33 does not use SO_REUSEPORT and should work with an old kernel.

UlricE commented 7 years ago

BTW, Direct Server Return is another option for UDP load balancing.

mozeq commented 7 years ago

Thanks for the quick response. Since I can't update the kernel, I will try to play with the DSR. I don't have any communication from the servers back to the clients in my use case, so it seems like the way to go anyway.