Merge pull request #6008 from hashicorp/doc-cgroup-raw-exec

document cgroup raw exec
This commit is contained in:
Lang Martin 2019-07-24 13:27:54 -04:00 committed by GitHub
commit 92ca20f18b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 4 deletions

View file

@ -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

View file

@ -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