Skip to content

Commit

Permalink
Merge pull request #6008 from hashicorp/doc-cgroup-raw-exec
Browse files Browse the repository at this point in the history
document cgroup raw exec
  • Loading branch information
langmartin committed Jul 24, 2019
2 parents e55f70a + c7cd018 commit c93ed21
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions drivers/shared/executor/executor_universal_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,12 @@ func (e *UniversalExecutor) configureResourceContainer(pid int) error {

err := configureBasicCgroups(cfg)
if err != nil {
// Debug this error to help diagnose cases where nomad is run with too few
// Log this error to help diagnose cases where nomad is run with too few
// permissions, but don't return an error. There is no separate check for
// cgroup creation permissions, so this may be the happy path.
e.logger.Debug("failed to create cgroup", "error", err)
e.logger.Warn("failed to create cgroup",
"docs", "https://www.nomadproject.io/docs/drivers/raw_exec.html#no_cgroups",
"error", err)
return nil
}
e.resConCtx.groups = cfg.Cgroups
Expand Down
6 changes: 4 additions & 2 deletions website/source/docs/drivers/raw_exec.html.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,10 @@ client {
* `no_cgroups` - Specifies whether the driver should not use
cgroups to manage the process group launched by the driver. By default,
cgroups are used to manage the process tree to ensure full cleanup of all
processes started by the task. The driver only uses cgroups when Nomad is
launched as root, on Linux and when cgroups are detected.
processes started by the task. The driver uses cgroups by default on
Linux and when `/sys/fs/cgroup/freezer/nomad` is writable for the
Nomad process. Using a cgroup significantly reduces Nomad's CPU
usage when collecting process metrics.

## Client Options

Expand Down

0 comments on commit c93ed21

Please sign in to comment.