]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#893] added documentation
authorRazvan Becheriu <razvan@isc.org>
Fri, 3 Apr 2020 12:09:19 +0000 (15:09 +0300)
committerRazvan Becheriu <razvan@isc.org>
Tue, 14 Apr 2020 19:20:29 +0000 (22:20 +0300)
doc/sphinx/arm/dhcp4-srv.rst
doc/sphinx/arm/dhcp6-srv.rst
src/bin/dhcp4/dhcp4_srv.h
src/bin/dhcp6/dhcp6_srv.h
src/lib/dhcpsrv/srv_config.cc

index 144caccc623ec3ed2f8b6dca9123c195582b8fb1..fc2ded57ccc99611244ae438380fd8bda0236994 100644 (file)
@@ -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
index c0fa7ba820bcd8e8def31f8340f9e377b2587e90..f2db5d9d90973f8884b9bebeb0637e84551045f3 100644 (file)
@@ -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
index 29db9b61a33b06c2f5b876e6707bc1173be04aa8..b35cf8936f974620c58cb660241c37f2ac55b1df 100644 (file)
@@ -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
index a9571d2f5c5de7e058450df7d58837c820fe340f..9c0cbc53f669cfb25f99eb10b7df6e6ff657dd3c 100644 (file)
@@ -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
index 391fc396e3d053c85f1ac7d62c807a9879c908fb..06969169adc57177d77654d5a033f2e38085ce70 100644 (file)
@@ -443,7 +443,15 @@ SrvConfig::toElement() const {
     // Set dhcp4o6-port
     dhcp->set("dhcp4o6-port",
               Element::create(static_cast<int>(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<int>(pkt_thread_pool_size_)));
+    // Set packet-thread-queue-size
+    dhcp->set("packet-thread-queue-size",
+             Element::create(static_cast<int>(pkt_thread_queue_size_)));
     // Set dhcp-ddns
     dhcp->set("dhcp-ddns", d2_client_config_->toElement());
     // Set interfaces-config