[systemd-devel] [PATCH] core: support Distribute=n to distribute to n workers

David Timothy Strauss david at davidstrauss.net
Mon Jan 6 04:14:40 PST 2014


On Sun, Jan 5, 2014 at 1:44 PM, Zbigniew Jędrzejewski-Szmek
<zbyszek at in.waw.pl> wrote:
> 3. The strategy of dup()ing the socket doesn't work. I wrote
>    a simple server in python which logs the connections [2], and hooked
>    it up into systemd [3-4] (*). If REUSEPORT was working correctly,
>    each connection would be handled by just one instance, either created
>    previously, or newly created by systemd for this connection. But
>    I see the same connection being accept()ed by one of the instances
>    and systemd itself spawning a new instance. I'm pretty sure that what
>    Lennart wrote before, that you need to create a new socket bound to
>    the same port for REUSEPORT to take effect, is true.

I've also seen pretty even (but not perfect, especially with
event-based designs) distribution with multiple processes simply
running accept() on the same inherited socket.


More information about the systemd-devel mailing list