Allow configuring nginx worker reload behaviour, to prevent multiple concurrent worker reloads which can lead to high resource usage and OOMKill (#10884)
* feat: allow configuring nginx worker reload behaviour, to prevent multiple concurrent worker reloads Signed-off-by: Rafael da Fonseca <rafael.fonseca@wildlifestudios.com> * appease linter, remove unnecessary log line Signed-off-by: Rafael da Fonseca <rafael.fonseca@wildlifestudios.com> * Flip to using a positive behaviour flag instead of negative Signed-off-by: Rafael da Fonseca <rafael.fonseca@wildlifestudios.com> * Update helm-docs Signed-off-by: Rafael da Fonseca <rafael.fonseca@wildlifestudios.com> * Avoid calling GetBackendConfiguration() twice, use clearer name for helm chart option Signed-off-by: Rafael da Fonseca <rafael.fonseca@wildlifestudios.com> * Fix helm-docs ordering Signed-off-by: Rafael da Fonseca <rafael.fonseca@wildlifestudios.com> --------- Signed-off-by: Rafael da Fonseca <rafael.fonseca@wildlifestudios.com>
This commit is contained in:
parent
689b993a3c
commit
4e11074323
7 changed files with 69 additions and 3 deletions
|
|
@ -69,6 +69,7 @@ const (
|
|||
luaSharedDictsKey = "lua-shared-dicts"
|
||||
plugins = "plugins"
|
||||
debugConnections = "debug-connections"
|
||||
workerSerialReloads = "enable-serial-reloads"
|
||||
)
|
||||
|
||||
var (
|
||||
|
|
@ -404,6 +405,17 @@ func ReadConfig(src map[string]string) config.Configuration {
|
|||
delete(conf, workerProcesses)
|
||||
}
|
||||
|
||||
if val, ok := conf[workerSerialReloads]; ok {
|
||||
boolVal, err := strconv.ParseBool(val)
|
||||
if err != nil {
|
||||
to.WorkerSerialReloads = false
|
||||
klog.Warningf("failed to parse enable-serial-reloads setting, valid values are true or false, found %s", val)
|
||||
} else {
|
||||
to.WorkerSerialReloads = boolVal
|
||||
}
|
||||
delete(conf, workerSerialReloads)
|
||||
}
|
||||
|
||||
if val, ok := conf[plugins]; ok {
|
||||
to.Plugins = splitAndTrimSpace(val, ",")
|
||||
delete(conf, plugins)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue