[Dovecot] Linux SO_REUSEPORT

staticsafe me at staticsafe.ca
Tue Sep 24 16:23:12 EEST 2013


On 9/24/2013 02:06, Ben Morrow wrote:
> At  2PM +0300 on 23/09/13 you Timo Sirainen wrote:
>>
> [SO_REUSEPORT]
>>
>> This feature originated from BSDs that had it long time ago.
>
> SO_REUSEPORT was introduced in 4.4 BSD, but the new Linux feature which
> includes load balancing is something rather different. It's a pity the
> Linux (Google?) people didn't choose a different name for it.
>
> 4.4's SO_REUSEPORT just allows multiple (pre-TIME_WAIT) sockets to bind
> to the same local address:port. It was introduced for the benefit of
> multicast apps; AFAIK its only significant non-multicast use is in ftpd,
> which in active mode has to create lots of outgoing sockets originating
> from the same source address:port. The question of load balancing
> obviously doesn't apply here, since the connections are initiated by the
> server.
>
> With a 4.4 implementation, setting SO_REUSEPORT is actively bad for
> something like Dovecot: while all the sockets will be allowed to bind,
> connections will only be passed to the first until that is closed, then
> to the next, and so on. Of the BSDs, DragonFly has implemented the Linux
> semantics (including a fix for the bug mentioned in your commit
> message); I believe the others, including OSX, are still using the 4.4
> code.
>
> Ben
>

Details of Linux SO_REUSEPORT implementation can be found here:
https://lwn.net/Articles/542629/

-- 
staticsafe
O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
Please don't top post. It is not logical.
Please don't CC me! I'm subscribed to whatever list I just posted on.


More information about the dovecot mailing list