From eb6a71fc0efbf6401858a36cf4469b04f228a6b4 Mon Sep 17 00:00:00 2001 From: Andrew Clayton Date: Fri, 16 Aug 2024 16:14:21 +0100 Subject: [PATCH 1/5] Add documentation for new 'backlog' config option Signed-off-by: Andrew Clayton --- source/configuration.rst | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/source/configuration.rst b/source/configuration.rst index 1e71a462..99af816e 100644 --- a/source/configuration.rst +++ b/source/configuration.rst @@ -99,6 +99,25 @@ Available listener options: defines SSL/TLS :ref:`settings `. + * - **backlog** + - Integer; + controls the 'backlog' parameter to the *listen(2)* system-call. + This essentially limits the number of pending connections waiting + to be accepted. + + The default varies by system. + + On Linux, FreeBSD, OpenBSD and macOS the default is **-1** which + means use the OS default. For example. on Linux since 5.4, this is + **4096** (previously **128**) and on FreeBSD it's **128**. + + On other systems default is **511**. + + NOTE: Whatever limit you set here will be limited by the OS + system-wide sysctl. For example. on Linux that is + **net.core.somaxconn** and on BSD it's **kern.ipc.somaxconn** + + *(since 1.33.0)* Here, a local listener accepts requests at port 8300 and passes them to the **blogs** app @@ -5662,4 +5681,4 @@ Example with njs and the use of a template literal: "if": "`${uri == '/health' ? false : true}`", "path": "..." } - } \ No newline at end of file + } From 2a144c5f006110649ea589b485391b89bb218d75 Mon Sep 17 00:00:00 2001 From: Andrew Clayton Date: Fri, 16 Aug 2024 17:26:53 +0100 Subject: [PATCH 2/5] Add documentation for new 'listen_threads' config option Signed-off-by: Andrew Clayton --- source/configuration.rst | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/source/configuration.rst b/source/configuration.rst index 99af816e..dc16688c 100644 --- a/source/configuration.rst +++ b/source/configuration.rst @@ -111,7 +111,7 @@ Available listener options: means use the OS default. For example. on Linux since 5.4, this is **4096** (previously **128**) and on FreeBSD it's **128**. - On other systems default is **511**. + On other systems the default is **511**. NOTE: Whatever limit you set here will be limited by the OS system-wide sysctl. For example. on Linux that is @@ -5376,6 +5376,16 @@ that stores instance-wide preferences. * - Option - Description + * - **listen_threads** + - Integer; + controls the number of router threads created to handle client + connections. Each thread includes all the configured listeners. + + By default, we create as many threads as the number of CPUs that + are available to run on. + + *(since 1.33.0)* + * - **http** - Object; fine-tunes handling of HTTP requests From c41a3c49ce9e4a66a811f137ad12212e778ff436 Mon Sep 17 00:00:00 2001 From: Andrew Clayton Date: Tue, 3 Sep 2024 19:08:57 +0100 Subject: [PATCH 3/5] Add documentation for new 'factory' Python config option Closes: https://github.com/nginx/unit-docs/issues/155 Signed-off-by: Andrew Clayton --- source/configuration.rst | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/source/configuration.rst b/source/configuration.rst index dc16688c..08537a7e 100644 --- a/source/configuration.rst +++ b/source/configuration.rst @@ -4739,6 +4739,16 @@ you have: The default is **application**. + * - **factory** + - Boolean: + when enabled, Unit treats **callable** as a factory. + + The default is **false**. + + **Note:** Unit does *not* support passing arguments to factories. + + *(since 1.33.0)* + * - **home** - String; path to the app's From 327a2979078a625be7bb5b1d1a163ed55164bbdb Mon Sep 17 00:00:00 2001 From: Andrew Clayton Date: Wed, 21 Aug 2024 21:52:34 +0100 Subject: [PATCH 4/5] Note from which version server_version is available Signed-off-by: Andrew Clayton --- source/configuration.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source/configuration.rst b/source/configuration.rst index 08537a7e..602115f6 100644 --- a/source/configuration.rst +++ b/source/configuration.rst @@ -5508,6 +5508,8 @@ In turn, the **http** option exposes the following settings: The default is **true**. + *(since 1.30.0)* + * - **static** - Object; configures static asset handling. From e6d116b07123e5428bc3201ba6abda831363867d Mon Sep 17 00:00:00 2001 From: Andrew Clayton Date: Tue, 3 Sep 2024 19:20:40 +0100 Subject: [PATCH 5/5] Clarify the stdout/stderr config options Closes: https://github.com/nginx/unit-docs/issues/147 Signed-off-by: Andrew Clayton --- source/configuration.rst | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/source/configuration.rst b/source/configuration.rst index 602115f6..ac93edee 100644 --- a/source/configuration.rst +++ b/source/configuration.rst @@ -3312,14 +3312,15 @@ shared between all application languages: * - **stderr**, **stdout** - Strings; - filenames where Unit redirects - the application's output. + filenames where Unit redirects the application's output. - The default is **/dev/null**. + The default when running *with* **--no-daemon** is to send + *stdout* to the *console* and *stderr* to Unit's *log*. - When running in **--no-daemon** mode, application output - is always redirected to - :ref:`Unit's log file `. + The default when running *without* **--no-daemon** is to send + *stdout* to */dev/null* and *stderr* to Unit's *log*. + + These options have *no* effect when running with **--no-daemon**. * - **user** - String;