lbagent: tunable tune.http.maxhdr

This commit is contained in:
Yousong Zhou
2020-01-15 12:14:27 +08:00
parent 5f16a5fae8
commit c1dacdda12
3 changed files with 10 additions and 0 deletions
+8
View File
@@ -104,6 +104,7 @@ type SLoadbalancerAgentParamsHaproxy struct {
LogHttp bool
LogTcp bool
LogNormal bool
TuneHttpMaxhdr int
}
type SLoadbalancerAgentParamsTelegraf struct {
@@ -196,6 +197,12 @@ func (p *SLoadbalancerAgentParamsHaproxy) Validate(data *jsonutils.JSONDict) err
// This is a limit imposed by haproxy and arch word size
p.GlobalNbthread = 64
}
if p.TuneHttpMaxhdr < 0 {
p.TuneHttpMaxhdr = 0
}
if p.TuneHttpMaxhdr > 32767 {
p.TuneHttpMaxhdr = 32767
}
return nil
}
@@ -761,6 +768,7 @@ global
maxconn 20480
tune.ssl.default-dh-param 2048
{{- println }}
{{- if .haproxy.tune_http_maxhdr }} tune.http.maxhdr {{ println .haproxy.tune_http_maxhdr }} {{- end }}
{{- if .haproxy.global_stats_socket }} {{ println .haproxy.global_stats_socket }} {{- end }}
{{- if .haproxy.global_nbthread }} nbthread {{ println .haproxy.global_nbthread }} {{- end }}
{{- if .haproxy.global_log }} {{ println .haproxy.global_log }} {{- end }}
+1
View File
@@ -234,6 +234,7 @@ type LoadbalancerAgentParamsHaproxy struct {
LogHttp bool
LogTcp bool
LogNormal bool
TuneHttpMaxhdr int
}
type LoadbalancerAgentParamsTelegraf struct {
@@ -43,6 +43,7 @@ type LoadbalancerAgentParamsOptions struct {
HaproxyLogHttp string `choices:"true|false"`
HaproxyLogTcp string `choices:"true|false"`
HaproxyLogNormal string `choices:"true|false"`
HaproxyTuneHttpMaxhdr *int `help:"max number of http headers allowed"`
TelegrafInfluxDbOutputUrl string
TelegrafInfluxDbOutputName string