Skip to content

Commit

Permalink
misc: add cgroup configuration for daemon
Browse files Browse the repository at this point in the history
Signed-off-by: Bin Tang <tangbin.bin@bytedance.com>
  • Loading branch information
sctb512 committed Jun 2, 2023
1 parent 00300b5 commit f20f46e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ func TestLoadSnapshotterTOMLConfig(t *testing.T) {
RecoverPolicy: "restart",
NydusdConfigPath: "/etc/nydus/nydusd-config.fusedev.json",
ThreadsNumber: 4,
CgroupConfig: CgroupConfig{
MemoryLimit: "",
MemoryWatermarkScaleFactor: 1000,
},
},
SnapshotsConfig: SnapshotConfig{
EnableNydusOverlayFS: false,
Expand Down
8 changes: 8 additions & 0 deletions misc/snapshotter/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,14 @@ recover_policy = "restart"
# Setting to 0 will use the default configuration of nydusd.
threads_number = 4

[daemon.cgroup]
# The memory limit for nydusd.slice, which contains all nydusd processes.
# Percentage is supported as well, please ensure it is end with '%'.
memory_limit = ""
# The memory watermark scale factor for nydusd.slice. This entry is invalid
# when the per-memcg reclaim is not supported.
memory_watermark_scale_factor = 1000

[log]
# Print logs to stdout rather than logging files
log_to_stdout = false
Expand Down

0 comments on commit f20f46e

Please sign in to comment.