Skip to content

Commit 487946b

Browse files
committed
Add description about new dump function of fluent-ctl and RPC
See also: fluent/fluentd#3680 Signed-off-by: Daijiro Fukuda <fukuda@clear-code.com>
1 parent 10ba2d2 commit 487946b

File tree

3 files changed

+40
-1
lines changed

3 files changed

+40
-1
lines changed

deployment/command-line-option.md

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,21 +161,57 @@ Options:
161161
Control `fluentd` process using [Signals](signals.md) or Windows Event.
162162

163163
```text
164-
Usage: fluent-ctl COMMAND PID
164+
Usage: fluent-ctl COMMAND PID_OR_SVCNAME
165165
166166
Commands:
167167
shutdown
168168
restart
169169
flush
170170
reload
171+
dump
171172
```
172173

173174
### Example
174175

176+
You can specify the process id of the supervisor process.
177+
175178
```text
176179
fluent-ctl shutdown 11111
177180
```
178181

182+
If you run Fluentd as a Windows service, then you have to specify the svcname (the name of the Windows service).
183+
184+
```text
185+
fluent-ctl dump fluentdwinsvc
186+
```
187+
188+
### About `dump`
189+
190+
This function is mainly for Windows.
191+
192+
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.
193+
194+
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.
195+
196+
```Powershell
197+
$ $env:SIGDUMP_PATH="/sigdump/sigdump.log" # The directory `sidgump` has to exist.
198+
$ fuentd -c ...
199+
$ fluent-ctl dump {PID_OR_SVCNAME} # At another shell.
200+
```
201+
202+
Then Fluentd dumps files as following. Each process id is automatically added to the path.
203+
204+
```text
205+
... [info]: fluent/log.rb:330:info: dump to /sigdump/sigdump-41544.log.
206+
... [info]: #0 fluent/log.rb:330:info: dump to /sigdump/sigdump-21152.log.
207+
... [info]: #1 fluent/log.rb:330:info: dump to /sigdump/sigdump-15656.log.
208+
...
209+
```
210+
211+
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.
212+
213+
The same feature is available in [RPC](rpc.md). On non-Windows, You can use this to easily get all processes' status.
214+
179215
## `fluent-cap-ctl`
180216

181217
Control Linux Capability for Fluentd. See [Linux Capability](linux-capability.md) article.

deployment/rpc.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ As evident from the output above, each endpoint returns a JSON object as its res
3030
| `/api/processes.interruptWorkers` | [SIGINT](signals.md#sigint-or-sigterm) | Stops the daemon. |
3131
| `/api/processes.killWorkers` | [SIGTERM](signals.md#sigint-or-sigterm) | Stops the daemon. |
3232
| `/api/processes.flushBuffersAndKillWorkers` | [SIGUSR1](signals.md#sigusr1) and [SIGTERM](signals.md#sigint-or-sigterm) | Flushes buffer and stops the daemon. |
33+
| `/api/processes.dump` | [SIGCONT](signals.md#sigcont) | Make all Fluentd processes dump their status. |
3334
| `/api/plugins.flushBuffers` | [SIGUSR1](signals.md#sigusr1) | Flushes the buffered messages. |
3435
| `/api/config.gracefulReload` | [SIGUSR2](signals.md#sigusr2) | Reloads configuration. |
3536
| `/api/config.reload` | [SIGHUP](signals.md#sighup) | Reloads configuration. |

deployment/trouble-shooting.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ $ fluentd .. -vv
6565

6666
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.
6767

68+
On Windows, you can use [fluent-ctl](command-line-option.md#fluent-ctl) or [RPC](rpc.md).
69+
6870
## High CPU Usage Issue
6971

7072
If `fluentd` suddenly hits unexpected high CPU usage problem, there are several reasons:

0 commit comments

Comments
 (0)