Skip to content

Commit

Permalink
Support config core dump limit (#817)
Browse files Browse the repository at this point in the history
Fix #540

Signed-off-by: lucklove <[email protected]>

Co-authored-by: ti-srebot <[email protected]>
  • Loading branch information
lucklove and ti-srebot authored Sep 27, 2020
1 parent dfab8de commit c7fbf19
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pkg/cluster/embed/autogen_pkger.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,6 @@ func init() {
autogenFiles["/templates/scripts/run_tikv.sh.tpl"] = "IyEvYmluL2Jhc2gKc2V0IC1lCgojIFdBUk5JTkc6IFRoaXMgZmlsZSB3YXMgYXV0by1nZW5lcmF0ZWQuIERvIG5vdCBlZGl0IQojICAgICAgICAgIEFsbCB5b3VyIGVkaXQgbWlnaHQgYmUgb3ZlcndyaXR0ZW4hCmNkICJ7ey5EZXBsb3lEaXJ9fSIgfHwgZXhpdCAxCgplY2hvIC1uICdzeW5jIC4uLiAnCnN0YXQ9JCh0aW1lIHN5bmMgfHwgc3luYykKZWNobyBvawplY2hvICRzdGF0Cgp7ey0gZGVmaW5lICJQRExpc3QifX0KICB7ey0gcmFuZ2UgJGlkeCwgJHBkIDo9IC59fQogICAge3stIGlmIGVxICRpZHggMH19CiAgICAgIHt7LSAkcGQuSVB9fTp7eyRwZC5DbGllbnRQb3J0fX0KICAgIHt7LSBlbHNlIC19fQogICAgICAse3skcGQuSVB9fTp7eyRwZC5DbGllbnRQb3J0fX0KICAgIHt7LSBlbmR9fQogIHt7LSBlbmR9fQp7ey0gZW5kfX0KCnt7LSBpZiAuTnVtYU5vZGV9fQpleGVjIG51bWFjdGwgLS1jcHVub2RlYmluZD17ey5OdW1hTm9kZX19IC0tbWVtYmluZD17ey5OdW1hTm9kZX19IGJpbi90aWt2LXNlcnZlciBcCnt7LSBlbHNlfX0KZXhlYyBiaW4vdGlrdi1zZXJ2ZXIgXAp7ey0gZW5kfX0KICAgIC0tYWRkciAie3suTGl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t7LSBpZiAuUmVzdGFydH19ClJlc3RhcnQ9e3suUmVzdGFydH19Cnt7ZWxzZX19ClJlc3RhcnQ9YWx3YXlzCnt7ZW5kfX0KUmVzdGFydFNlYz0xNXMKe3stIGlmIC5EaXNhYmxlU2VuZFNpZ2tpbGx9fQpTZW5kU0lHS0lMTD1ubwp7ey0gZW5kfX0KCltJbnN0YWxsXQpXYW50ZWRCeT1tdWx0aS11c2VyLnRhcmdldAo="
autogenFiles["/templates/systemd/tispark.service.tpl"] = "W1VuaXRdCkRlc2NyaXB0aW9uPXt7LlNlcnZpY2VOYW1lfX0gc2VydmljZQpBZnRlcj1zeXNsb2cudGFyZ2V0IG5ldHdvcmsudGFyZ2V0IHJlbW90ZS1mcy50YXJnZXQgbnNzLWxvb2t1cC50YXJnZXQKCltTZXJ2aWNlXQpVc2VyPXt7LlVzZXJ9fQp7ey0gaWYgbmUgLkphdmFIb21lICIifX0KRW52aXJvbm1lbnQ9IkpBVkFfSE9NRT17ey5KYXZhSG9tZX19Igp7ey0gZW5kfX0KRXhlY1N0YXJ0PXt7LkRlcGxveURpcn19L3NiaW4vc3RhcnQte3suU2VydmljZU5hbWV9fS5zaApFeGVjU3RvcD17ey5EZXBsb3lEaXJ9fS9zYmluL3N0b3Ate3suU2VydmljZU5hbWV9fS5zaApUeXBlPWZvcmtpbmcKe3stIGlmIC5SZXN0YXJ0fX0KUmVzdGFydD17ey5SZXN0YXJ0fX0Ke3tlbHNlfX0KUmVzdGFydD1hbHdheXMKe3stIGVuZH19ClJlc3RhcnRTZWM9MTVzClNlbmRTSUdLSUxMPW5vCgpbSW5zdGFsbF0KV2FudGVkQnk9bXVsdGktdXNlci50YXJnZXQK"
}
4 changes: 4 additions & 0 deletions pkg/cluster/spec/instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ func (i *BaseInstance) InitConfig(e executor.Executor, opt GlobalOptions, user s
systemCfg := system.NewConfig(comp, user, paths.Deploy).
WithMemoryLimit(resource.MemoryLimit).
WithCPUQuota(resource.CPUQuota).
WithLimitCORE(resource.LimitCORE).
WithIOReadBandwidthMax(resource.IOReadBandwidthMax).
WithIOWriteBandwidthMax(resource.IOWriteBandwidthMax)

Expand Down Expand Up @@ -364,6 +365,9 @@ func MergeResourceControl(lhs, rhs meta.ResourceControl) meta.ResourceControl {
if rhs.IOWriteBandwidthMax != "" {
lhs.IOWriteBandwidthMax = rhs.IOWriteBandwidthMax
}
if rhs.LimitCORE != "" {
lhs.LimitCORE = rhs.LimitCORE
}
return lhs
}

Expand Down
7 changes: 7 additions & 0 deletions pkg/cluster/template/systemd/system.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ type Config struct {
CPUQuota string
IOReadBandwidthMax string
IOWriteBandwidthMax string
LimitCORE string
DeployDir string
DisableSendSigkill bool
// Takes one of no, on-success, on-failure, on-abnormal, on-watchdog, on-abort, or always.
Expand Down Expand Up @@ -70,6 +71,12 @@ func (c *Config) WithIOWriteBandwidthMax(io string) *Config {
return c
}

// WithLimitCORE set the LimitCORE field of Config
func (c *Config) WithLimitCORE(core string) *Config {
c.LimitCORE = core
return c
}

// ConfigToFile write config content to specific path
func (c *Config) ConfigToFile(file string) error {
config, err := c.Config()
Expand Down
1 change: 1 addition & 0 deletions pkg/meta/resource_ctrl.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@ type ResourceControl struct {
CPUQuota string `yaml:"cpu_quota,omitempty" validate:"cpu_quota:editable"`
IOReadBandwidthMax string `yaml:"io_read_bandwidth_max,omitempty" validate:"io_read_bandwidth_max:editable"`
IOWriteBandwidthMax string `yaml:"io_write_bandwidth_max,omitempty" validate:"io_write_bandwidth_max:editable"`
LimitCORE string `yaml:"limit_core,omitempty" validate:"limit_core:editable"`
}
4 changes: 3 additions & 1 deletion templates/systemd/system.service.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@ IOReadBandwidthMax={{.IOReadBandwidthMax}}
{{- if .IOWriteBandwidthMax}}
IOWriteBandwidthMax={{.IOWriteBandwidthMax}}
{{- end}}
{{- if .LimitCORE}}
LimitCORE={{.LimitCORE}}
{{- end}}
LimitNOFILE=1000000
#LimitCORE=infinity
LimitSTACK=10485760

User={{.User}}
Expand Down

0 comments on commit c7fbf19

Please sign in to comment.