From: Marcin Siodelski Date: Thu, 12 Jan 2023 18:52:18 +0000 (+0100) Subject: [#2688] Documented new config parameters X-Git-Tag: Kea-2.2.1~35 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3641493ca6f1063f5df6913ee456fb27d1982bd1;p=thirdparty%2Fkea.git [#2688] Documented new config parameters --- diff --git a/doc/sphinx/arm/dhcp4-srv.rst b/doc/sphinx/arm/dhcp4-srv.rst index 534c18e4f7..f75ee6e3fd 100644 --- a/doc/sphinx/arm/dhcp4-srv.rst +++ b/doc/sphinx/arm/dhcp4-srv.rst @@ -548,6 +548,49 @@ access the database should be set: If there is no password to the account, set the password to the empty string ``""``. (This is the default.) +.. _tuning-database-timeouts4: + +Tuning Database Timeouts +~~~~~~~~~~~~~~~~~~~~~~~~ + +In rare cases, reading or writing to the database may hang. It can be +caused by a temporary network issue or misconfiguration of the proxy +server switching the connection between different database instances. +These situations are rare, but we have received reports from the users +that Kea can sometimes hang while performing the database IO operations. +Setting appropriate timeout values can mitigate such issues. + +MySQL exposes two distinct connection options to configure the read and +write timeouts. Kea's corresponding ``read-timeout`` and ``write-timeout`` +configuration parameters specify the timeouts in seconds. For example: + +:: + + "Dhcp4": { "lease-database": { "read-timeout" : 10, "write-timeout": 20, ... }, ... } + + +Setting these parameters to 0 is equivalent to not specifying them and +causes the Kea server to establish a connection to the database with the +MySQL defaults. In this case, Kea waits infinitely for the completion of +the read and write operations. + +MySQL versions earlier than 5.6 do not support setting timeouts for the +read and write operations. Moreover, the ``read-timeout`` and ``write-timeout`` +parameters can only be specified for the MySQL backend. Setting them for +any other backend type causes a configuration error. + +To set a timeout for PostgreSQL, use the ``tcp-user-timeout`` parameter +instead. For example: + +:: + + "Dhcp4": { "lease-database": { "tcp-user-timeout" : 10, ... }, ... } + + +Specifying this parameter for other backend types causes a configuration +error. + + .. _hosts4-storage: Hosts Storage @@ -763,6 +806,12 @@ the parameter is not specified. The ``readonly`` parameter is only supported for MySQL and PostgreSQL databases. + +Tuning Database Timeouts for Hosts Storage +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +See :ref:`tuning-database-timeouts4`. + .. _dhcp4-interface-configuration: Interface Configuration diff --git a/doc/sphinx/arm/dhcp6-srv.rst b/doc/sphinx/arm/dhcp6-srv.rst index 1009a6ee2d..2fed23c104 100644 --- a/doc/sphinx/arm/dhcp6-srv.rst +++ b/doc/sphinx/arm/dhcp6-srv.rst @@ -505,6 +505,49 @@ access the database should be set: If there is no password to the account, set the password to the empty string ``""``. (This is the default.) +.. _tuning-database-timeouts6: + +Tuning Database Timeouts +~~~~~~~~~~~~~~~~~~~~~~~~ + +In rare cases, reading or writing to the database may hang. It can be +caused by a temporary network issue or misconfiguration of the proxy +server switching the connection between different database instances. +These situations are rare, but we have received reports from the users +that Kea can sometimes hang while performing the database IO operations. +Setting appropriate timeout values can mitigate such issues. + +MySQL exposes two distinct connection options to configure the read and +write timeouts. Kea's corresponding ``read-timeout`` and ``write-timeout`` +configuration parameters specify the timeouts in seconds. For example: + +:: + + "Dhcp6": { "lease-database": { "read-timeout" : 10, "write-timeout": 20, ... }, ... } + + +Setting these parameters to 0 is equivalent to not specifying them and +causes the Kea server to establish a connection to the database with the +MySQL defaults. In this case, Kea waits infinitely for the completion of +the read and write operations. + +MySQL versions earlier than 5.6 do not support setting timeouts for the +read and write operations. Moreover, the ``read-timeout`` and ``write-timeout`` +parameters can only be specified for the MySQL backend. Setting them for +any other backend type causes a configuration error. + +To set a timeout for PostgreSQL, use the ``tcp-user-timeout`` parameter +instead. For example: + +:: + + "Dhcp6": { "lease-database": { "tcp-user-timeout" : 10, ... }, ... } + + +Specifying this parameter for other backend types causes a configuration +error. + + .. _hosts6-storage: Hosts Storage @@ -720,6 +763,13 @@ the parameter is not specified. The ``readonly`` parameter is only supported for MySQL and PostgreSQL databases. + +Tuning Database Timeouts for Hosts Storage +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +See :ref:`tuning-database-timeouts6`. + + .. _dhcp6-interface-configuration: Interface Configuration