[systemd-devel] [PATCH 4/4] core: lazy distribute for Distribute pools
Lennart Poettering
lennart at poettering.net
Sun Nov 17 11:46:46 PST 2013
On Sat, 16.11.13 13:18, Shawn Landden (shawn at churchofgit.com) wrote:
> ---
> man/systemd.socket.xml | 9 +++++++++
> src/core/dbus-socket.c | 2 ++
> src/core/load-fragment-gperf.gperf.m4 | 1 +
> src/core/socket.c | 7 ++++++-
> src/core/socket.h | 1 +
> 5 files changed, 19 insertions(+), 1 deletion(-)
>
> diff --git a/man/systemd.socket.xml b/man/systemd.socket.xml
> index 4a2189b..fd6ec69 100644
> --- a/man/systemd.socket.xml
> +++ b/man/systemd.socket.xml
> @@ -530,6 +530,15 @@
> </varlistentry>
>
> <varlistentry>
> + <term><varname>LazyDistribute=</varname></term>
> + <listitem><para>Takes an boolean
> + value. If true, Distribute=n workers will not be spawned
> + simultameously, but one at a time while connections come it
> + until n are running. Because of the nature of SO_REUSEPORT workers are
> + spawned at an exponentially decreasing rate to the number of incoming connections.</para></listitem>
> + </varlistentry>
> +
> + <varlistentry>
Hmm, so I think support for SO_REUSEPORT should just be a special case
of the Distribute= logic. i.e. When Distribute= is set but ReusePort is
off, then we'd pass the same original listening socket to all services
we spawn. If Distribute is set but ReusePort is on then we'd create a
new socket when we want to spawn a new instance, and simply bind it to
the same sockaddr as the original one.
Thinking about this: I have the suspicion that LazyDistribute shouldn't
be an option but the normal and only behaviour...
Lennart
--
Lennart Poettering, Red Hat
More information about the systemd-devel
mailing list