diff --git a/doc/sphinx/arm/dhcp4-srv.rst b/doc/sphinx/arm/dhcp4-srv.rst index 144caccc62..fc2ded57cc 100644 --- a/doc/sphinx/arm/dhcp4-srv.rst +++ b/doc/sphinx/arm/dhcp4-srv.rst @@ -3737,6 +3737,36 @@ be retained on the lease. The lease's user-context will look something like thi purposes. As long as no other purpose also writes an "ISC" element to user-context there should not be a conflict. +.. _dhcp4-multi-threading-settings: + +Multi-threading settings +------------------------ + +The Kea server can be configured to process packets in parallel using multiple +threads. Related setting for this feature are: + +- ``enable-multi-threading`` - use multiple threads to process packets in + parallel + +- ``packet-thread-pool-size`` - specify the number of threads to process + packets in parallel. Supported values are: 0 (autodetect), any positive + number sets number of threads explicitly. + +- ``packet-thread-queue-size`` - specify the size of the queue used by each + thread to process packets. Supported values are: 0 (unlimited), any positive + number sets size explicitly. + +An example configuration that sets these parameter looks as follows: + +:: + + "Dhcp4": { + "enable-multi-threading": true, + "packet-thread-pool-size": 4, + "packet-thread-queue-size": 16, + ... + } + .. _host-reservation-v4: Host Reservation in DHCPv4 diff --git a/doc/sphinx/arm/dhcp6-srv.rst b/doc/sphinx/arm/dhcp6-srv.rst index c0fa7ba820..f2db5d9d90 100644 --- a/doc/sphinx/arm/dhcp6-srv.rst +++ b/doc/sphinx/arm/dhcp6-srv.rst @@ -3249,6 +3249,36 @@ pretty-printed for clarity): container serving mulitple purposes. As long as no other purpose also writes an "ISC" element to user-context there should not be a conflict. +.. _dhcp6-multi-threading-settings: + +Multi-threading settings +------------------------ + +The Kea server can be configured to process packets in parallel using multiple +threads. Related setting for this feature are: + +- ``enable-multi-threading`` - use multiple threads to process packets in + parallel + +- ``packet-thread-pool-size`` - specify the number of threads to process + packets in parallel. Supported values are: 0 (autodetect), any positive + number sets number of threads explicitly. + +- ``packet-thread-queue-size`` - specify the size of the queue used by each + thread to process packets. Supported values are: 0 (unlimited), any positive + number sets size explicitly. + +An example configuration that sets these parameter looks as follows: + +:: + + "Dhcp6": { + "enable-multi-threading": true, + "packet-thread-pool-size": 4, + "packet-thread-queue-size": 16, + ... + } + .. _host-reservation-v6: Host Reservation in DHCPv6 diff --git a/src/bin/dhcp4/dhcp4_srv.h b/src/bin/dhcp4/dhcp4_srv.h index 29db9b61a3..b35cf8936f 100644 --- a/src/bin/dhcp4/dhcp4_srv.h +++ b/src/bin/dhcp4/dhcp4_srv.h @@ -1062,9 +1062,9 @@ protected: public: /// @brief command line parameter thread count - /// when parameter is not specified, the default value is used - /// the default value is: -1 means disabled (single-threaded), - /// 0 means auto-detect, other values set thread count explicitly + /// when parameter is not specified, the default value -1 is used + /// which means disabled (single-threaded), 0 means auto-detect, other + /// values set thread count explicitly. static int srv_thread_count_; /// Class methods for DHCPv4-over-DHCPv6 handler diff --git a/src/bin/dhcp6/dhcp6_srv.h b/src/bin/dhcp6/dhcp6_srv.h index a9571d2f5c..9c0cbc53f6 100644 --- a/src/bin/dhcp6/dhcp6_srv.h +++ b/src/bin/dhcp6/dhcp6_srv.h @@ -1062,9 +1062,9 @@ protected: public: /// @brief command line parameter thread count - /// when parameter is not specified, the default value is used - /// the default value is: -1 means disabled (single-threaded), - /// 0 means auto-detect, other values set thread count explicitly + /// when parameter is not specified, the default value -1 is used + /// which means disabled (single-threaded), 0 means auto-detect, other + /// values set thread count explicitly. static int srv_thread_count_; /// @note used by DHCPv4-over-DHCPv6 so must be public and static diff --git a/src/lib/dhcpsrv/srv_config.cc b/src/lib/dhcpsrv/srv_config.cc index 391fc396e3..06969169ad 100644 --- a/src/lib/dhcpsrv/srv_config.cc +++ b/src/lib/dhcpsrv/srv_config.cc @@ -443,7 +443,15 @@ SrvConfig::toElement() const { // Set dhcp4o6-port dhcp->set("dhcp4o6-port", Element::create(static_cast(dhcp4o6_port_))); - + // Set enable-multi-threading + dhcp->set("enable-multi-threading", + Element::create(enable_multi_threading_)); + // Set packet-thread-pool-size + dhcp->set("packet-thread-pool-size", + Element::create(static_cast(pkt_thread_pool_size_))); + // Set packet-thread-queue-size + dhcp->set("packet-thread-queue-size", + Element::create(static_cast(pkt_thread_queue_size_))); // Set dhcp-ddns dhcp->set("dhcp-ddns", d2_client_config_->toElement()); // Set interfaces-config