Commit 7f78a896 authored by Marek Vavruša's avatar Marek Vavruša

daemon: updated libuv requirements doc, msg when SO_REUSEPORT isn't available

parent e67c3090
......@@ -79,6 +79,8 @@ You can add start and stop processes on runtime based on the load.
│ └─kresd(19212)
└─pstree(19460)
.. _daemon-reuseport:
.. note:: On recent Linux supporting ``SO_REUSEPORT`` (since 3.9, backported to RHEL 2.6.32) it is also able to bind to the same endpoint and distribute the load between the forked processes. If the kernel doesn't support it, you can still fork multiple processes on different ports, and do load balancing externally (on firewall or with `dnsdist <http://dnsdist.org/>`_).
Notice the absence of an interactive CLI. You can attach to the the consoles for each process, they are in ``rundir/tty/PID``.
......
......@@ -228,6 +228,12 @@ int main(int argc, char **argv)
log_error("[system] error '-f' requires number, not '%s'\n", optarg);
return EXIT_FAILURE;
}
#if (!defined(UV_VERSION_HEX)) || (!defined(SO_REUSEPORT))
if (forks > 1) {
log_error("[system] libuv 1.7+ is required for SO_REUSEPORT support, multiple forks not supported\n");
return EXIT_FAILURE;
}
#endif
break;
case 'k':
keyfile = realpath(optarg, keyfile_buf);
......
......@@ -32,7 +32,7 @@ The following is a list of software required to build Knot DNS Resolver from sou
"C compiler", "*all*", "*(build only)* [#]_"
"libknot_ 2.0+", "*all*", "Knot DNS library (requires autotools, GnuTLS and Jansson)."
"LuaJIT_ 2.0+", "``daemon``", "Embedded scripting language (Lua_ 5.1+ with limitations)."
"libuv_ 1.0+", "``daemon``", "Multiplatform I/O and services."
"libuv_ 1.7+", "``daemon``", "Multiplatform I/O and services (libuv_ 1.0 with limitations [#]_)."
There are also *optional* packages that enable specific functionality in Knot DNS Resolver, they are useful mainly for developers to build documentation and tests.
......@@ -49,6 +49,7 @@ There are also *optional* packages that enable specific functionality in Knot DN
.. [#] Requires C99, ``__attribute__((cleanup))`` and ``-MMD -MP`` for dependency file generation. GCC, Clang and ICC are supported.
.. [#] You can use variables ``<dependency>_CFLAGS`` and ``<dependency>_LIBS`` to configure dependencies manually (i.e. ``libknot_CFLAGS`` and ``libknot_LIBS``).
.. [#] libuv 1.7 brings SO_REUSEPORT support that is needed for multiple forks. libuv < 1.7 can be still used, but only in single-process mode. Use :ref:`different method <daemon-reuseport>` for load balancing.
Getting Docker image
--------------------
......@@ -145,4 +146,4 @@ The project can be built with code coverage tracking using the ``COVERAGE=1`` va
.. _cmocka: https://cmocka.org/
.. _Python: https://www.python.org/
.. _boot2docker: http://boot2docker.io/
\ No newline at end of file
.. _boot2docker: http://boot2docker.io/
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment