Skip to content

Commit

Permalink
Merge pull request #397 from daipom/add-description-about-new-dump-func
Browse files Browse the repository at this point in the history
1.0: Add description about new dump function of fluent-ctl and RPC
  • Loading branch information
ashie committed Jun 29, 2022
2 parents 9afb20c + dc0ddcf commit a478cbb
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 1 deletion.
36 changes: 35 additions & 1 deletion deployment/command-line-option.md
Expand Up @@ -162,21 +162,55 @@ 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 can omit `PID_OR_SVCNAME` when the service name is the default value `fluentdwinsvc`.

```text
fluent-ctl dump
```

### 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 # 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.

## `fluent-cap-ctl`

Control Linux Capability for Fluentd. See [Linux Capability](linux-capability.md) article.
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).

## High CPU Usage Issue

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

0 comments on commit a478cbb

Please sign in to comment.