Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.0: Add description about new dump function of fluent-ctl and RPC #397

Merged
merged 3 commits into from Jun 29, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
38 changes: 37 additions & 1 deletion deployment/command-line-option.md
Expand Up @@ -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
daipom marked this conversation as resolved.
Show resolved Hide resolved

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
```
daipom marked this conversation as resolved.
Show resolved Hide resolved

### 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.
Expand Down
1 change: 1 addition & 0 deletions deployment/rpc.md
Expand Up @@ -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. |
Expand Down
2 changes: 2 additions & 0 deletions deployment/trouble-shooting.md
Expand Up @@ -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:
Expand Down