fix(worker): extended rsync memory limit to 512MB

This commit is contained in:
bigeagle 2016-12-04 22:43:59 +08:00
parent 6dd06c954c
commit 96f9db8bb8
No known key found for this signature in database
GPG Key ID: 9171A4571C27920A
2 changed files with 2 additions and 2 deletions

View File

@ -58,7 +58,7 @@ func (c *cgroupHook) preExec() error {
if c.provider.Type() == provRsync || c.provider.Type() == provTwoStageRsync { if c.provider.Type() == provRsync || c.provider.Type() == provTwoStageRsync {
gname := fmt.Sprintf("%s/%s", c.baseGroup, c.provider.Name()) gname := fmt.Sprintf("%s/%s", c.baseGroup, c.provider.Name())
return sh.Command( return sh.Command(
"cgset", "-r", "memory.limit_in_bytes=128M", gname, "cgset", "-r", "memory.limit_in_bytes=512M", gname,
).Run() ).Run()
} }
return nil return nil

View File

@ -137,7 +137,7 @@ sleep 30
if cgSubsystem == "memory" { if cgSubsystem == "memory" {
memoLimit, err := ioutil.ReadFile(filepath.Join(cg.basePath, "memory", cg.baseGroup, provider.Name(), "memory.limit_in_bytes")) memoLimit, err := ioutil.ReadFile(filepath.Join(cg.basePath, "memory", cg.baseGroup, provider.Name(), "memory.limit_in_bytes"))
So(err, ShouldBeNil) So(err, ShouldBeNil)
So(strings.Trim(string(memoLimit), "\n"), ShouldEqual, strconv.Itoa(128*1024*1024)) So(strings.Trim(string(memoLimit), "\n"), ShouldEqual, strconv.Itoa(512*1024*1024))
} }
cg.postExec() cg.postExec()
}) })