From 487946b06b4411149923b2bd81be516ac279ca83 Mon Sep 17 00:00:00 2001 From: Daijiro Fukuda Date: Fri, 25 Mar 2022 19:10:04 +0900 Subject: [PATCH 1/3] Add description about new dump function of fluent-ctl and RPC See also: https://github.com/fluent/fluentd/pull/3680 Signed-off-by: Daijiro Fukuda --- deployment/command-line-option.md | 38 ++++++++++++++++++++++++++++++- deployment/rpc.md | 1 + deployment/trouble-shooting.md | 2 ++ 3 files changed, 40 insertions(+), 1 deletion(-) diff --git a/deployment/command-line-option.md b/deployment/command-line-option.md index f88e471b..99626f85 100644 --- a/deployment/command-line-option.md +++ b/deployment/command-line-option.md @@ -161,21 +161,57 @@ Options: Control `fluentd` process using [Signals](signals.md) or Windows Event. ```text -Usage: fluent-ctl COMMAND PID +Usage: fluent-ctl COMMAND PID_OR_SVCNAME Commands: shutdown restart flush reload + dump ``` ### Example +You can specify the process id of the supervisor process. + ```text fluent-ctl shutdown 11111 ``` +If you run Fluentd as a Windows service, then you have to specify the svcname (the name of the Windows service). + +```text +fluent-ctl dump fluentdwinsvc +``` + +### About `dump` + +This function is mainly for Windows. + +On Windows, this makes all Fluentd processes (including all worker processes) dump their internal status to the system temp directory (`C:\\Windows\\Temp`). This is the same behavior as sending SIGCONT to all processes on non-Windows. + +Since this uses [SIGDUMP](https://github.com/frsyuki/sigdump), you can change the output path by specifying `SIGDUMP_PATH` environment variable. Note that the path has to be a file path. + +```Powershell +$ $env:SIGDUMP_PATH="/sigdump/sigdump.log" # The directory `sidgump` has to exist. +$ fuentd -c ... +$ fluent-ctl dump {PID_OR_SVCNAME} # At another shell. +``` + +Then Fluentd dumps files as following. Each process id is automatically added to the path. + +```text +... [info]: fluent/log.rb:330:info: dump to /sigdump/sigdump-41544.log. +... [info]: #0 fluent/log.rb:330:info: dump to /sigdump/sigdump-21152.log. +... [info]: #1 fluent/log.rb:330:info: dump to /sigdump/sigdump-15656.log. +... +``` + +As for non-Windows, you don't have to use this function because you can manually send SIGCONT to each process. Although you can use this function on non-Windows, this just sends SIGCONT to the supervisor process, so you can get only the status of the supervisor process. + +The same feature is available in [RPC](rpc.md). On non-Windows, You can use this to easily get all processes' status. + ## `fluent-cap-ctl` Control Linux Capability for Fluentd. See [Linux Capability](linux-capability.md) article. diff --git a/deployment/rpc.md b/deployment/rpc.md index bcb2d288..ebe4f03c 100644 --- a/deployment/rpc.md +++ b/deployment/rpc.md @@ -30,6 +30,7 @@ As evident from the output above, each endpoint returns a JSON object as its res | `/api/processes.interruptWorkers` | [SIGINT](signals.md#sigint-or-sigterm) | Stops the daemon. | | `/api/processes.killWorkers` | [SIGTERM](signals.md#sigint-or-sigterm) | Stops the daemon. | | `/api/processes.flushBuffersAndKillWorkers` | [SIGUSR1](signals.md#sigusr1) and [SIGTERM](signals.md#sigint-or-sigterm) | Flushes buffer and stops the daemon. | +| `/api/processes.dump` | [SIGCONT](signals.md#sigcont) | Make all Fluentd processes dump their status. | | `/api/plugins.flushBuffers` | [SIGUSR1](signals.md#sigusr1) | Flushes the buffered messages. | | `/api/config.gracefulReload` | [SIGUSR2](signals.md#sigusr2) | Reloads configuration. | | `/api/config.reload` | [SIGHUP](signals.md#sighup) | Reloads configuration. | diff --git a/deployment/trouble-shooting.md b/deployment/trouble-shooting.md index 48c34800..95ea0adf 100644 --- a/deployment/trouble-shooting.md +++ b/deployment/trouble-shooting.md @@ -65,6 +65,8 @@ $ fluentd .. -vv Fluentd uses [SIGDUMP](https://github.com/frsyuki/sigdump) for dumping fluentd internal information to a local file, e.g. thread dump, object allocation, etc. If you have a problem with fluentd like process hang, please send `SIGCONT` to fluentd parent and child processes. +On Windows, you can use [fluent-ctl](command-line-option.md#fluent-ctl) or [RPC](rpc.md). + ## High CPU Usage Issue If `fluentd` suddenly hits unexpected high CPU usage problem, there are several reasons: From 1e99dc7ff950fed4b9cb1c5f8e4af685f4d1e866 Mon Sep 17 00:00:00 2001 From: Daijiro Fukuda Date: Thu, 19 May 2022 18:48:33 +0900 Subject: [PATCH 2/3] Remove description about RPC We ended up removing RPC dump function. See also: https://github.com/fluent/fluentd/pull/3680 Signed-off-by: Daijiro Fukuda --- deployment/command-line-option.md | 2 -- deployment/rpc.md | 1 - deployment/trouble-shooting.md | 2 +- 3 files changed, 1 insertion(+), 4 deletions(-) diff --git a/deployment/command-line-option.md b/deployment/command-line-option.md index 99626f85..02a62564 100644 --- a/deployment/command-line-option.md +++ b/deployment/command-line-option.md @@ -210,8 +210,6 @@ Then Fluentd dumps files as following. Each process id is automatically added to As for non-Windows, you don't have to use this function because you can manually send SIGCONT to each process. Although you can use this function on non-Windows, this just sends SIGCONT to the supervisor process, so you can get only the status of the supervisor process. -The same feature is available in [RPC](rpc.md). On non-Windows, You can use this to easily get all processes' status. - ## `fluent-cap-ctl` Control Linux Capability for Fluentd. See [Linux Capability](linux-capability.md) article. diff --git a/deployment/rpc.md b/deployment/rpc.md index ebe4f03c..bcb2d288 100644 --- a/deployment/rpc.md +++ b/deployment/rpc.md @@ -30,7 +30,6 @@ As evident from the output above, each endpoint returns a JSON object as its res | `/api/processes.interruptWorkers` | [SIGINT](signals.md#sigint-or-sigterm) | Stops the daemon. | | `/api/processes.killWorkers` | [SIGTERM](signals.md#sigint-or-sigterm) | Stops the daemon. | | `/api/processes.flushBuffersAndKillWorkers` | [SIGUSR1](signals.md#sigusr1) and [SIGTERM](signals.md#sigint-or-sigterm) | Flushes buffer and stops the daemon. | -| `/api/processes.dump` | [SIGCONT](signals.md#sigcont) | Make all Fluentd processes dump their status. | | `/api/plugins.flushBuffers` | [SIGUSR1](signals.md#sigusr1) | Flushes the buffered messages. | | `/api/config.gracefulReload` | [SIGUSR2](signals.md#sigusr2) | Reloads configuration. | | `/api/config.reload` | [SIGHUP](signals.md#sighup) | Reloads configuration. | diff --git a/deployment/trouble-shooting.md b/deployment/trouble-shooting.md index 95ea0adf..7c0cf912 100644 --- a/deployment/trouble-shooting.md +++ b/deployment/trouble-shooting.md @@ -65,7 +65,7 @@ $ fluentd .. -vv Fluentd uses [SIGDUMP](https://github.com/frsyuki/sigdump) for dumping fluentd internal information to a local file, e.g. thread dump, object allocation, etc. If you have a problem with fluentd like process hang, please send `SIGCONT` to fluentd parent and child processes. -On Windows, you can use [fluent-ctl](command-line-option.md#fluent-ctl) or [RPC](rpc.md). +On Windows, you can use [fluent-ctl](command-line-option.md#fluent-ctl). ## High CPU Usage Issue From dc0ddcfc33deb68577738093d0d519d23bf1c68f Mon Sep 17 00:00:00 2001 From: Daijiro Fukuda Date: Wed, 29 Jun 2022 17:13:53 +0900 Subject: [PATCH 3/3] Fix description about `PID_OR_SVCNAME` argument See also: https://github.com/fluent/fluentd/pull/3680 Signed-off-by: Daijiro Fukuda --- deployment/command-line-option.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/deployment/command-line-option.md b/deployment/command-line-option.md index 02a62564..f44e3319 100644 --- a/deployment/command-line-option.md +++ b/deployment/command-line-option.md @@ -161,7 +161,7 @@ Options: Control `fluentd` process using [Signals](signals.md) or Windows Event. ```text -Usage: fluent-ctl COMMAND PID_OR_SVCNAME +Usage: fluent-ctl COMMAND [PID_OR_SVCNAME] Commands: shutdown @@ -179,10 +179,10 @@ You can specify the process id of the supervisor process. fluent-ctl shutdown 11111 ``` -If you run Fluentd as a Windows service, then you have to specify the svcname (the name of the Windows service). +If you run Fluentd as a Windows service, then you can omit `PID_OR_SVCNAME` when the service name is the default value `fluentdwinsvc`. ```text -fluent-ctl dump fluentdwinsvc +fluent-ctl dump ``` ### About `dump` @@ -196,7 +196,7 @@ Since this uses [SIGDUMP](https://github.com/frsyuki/sigdump), you can change th ```Powershell $ $env:SIGDUMP_PATH="/sigdump/sigdump.log" # The directory `sidgump` has to exist. $ fuentd -c ... -$ fluent-ctl dump {PID_OR_SVCNAME} # At another shell. +$ fluent-ctl dump # At another shell. ``` Then Fluentd dumps files as following. Each process id is automatically added to the path.