From 434256f9cca5cd5825963f577571773b8ca66cb8 Mon Sep 17 00:00:00 2001 From: Marcos Lilljedahl Date: Wed, 1 Feb 2017 17:29:14 -0300 Subject: [PATCH] Increase pidslimit to 1000 and allow to override via env var --- services/docker.go | 10 +++++++++- www/welcome.html | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/services/docker.go b/services/docker.go index 94407ad..4f505f1 100644 --- a/services/docker.go +++ b/services/docker.go @@ -5,6 +5,7 @@ import ( "io" "log" "os" + "strconv" "strings" "github.com/docker/docker/api/types" @@ -188,7 +189,14 @@ func CreateInstance(session *Session, dindImage string) (*Instance, error) { if os.Getenv("APPARMOR_PROFILE") != "" { h.SecurityOpt = []string{fmt.Sprintf("apparmor=%s", os.Getenv("APPARMOR_PROFILE"))} } - h.Resources.PidsLimit = int64(500) + + var pidsLimit = int64(1000) + if envLimit := os.Getenv("MAX_PROCESSES"); envLimit != "" { + if i, err := strconv.Atoi(envLimit); err != nil { + pidsLimit = int64(i) + } + } + h.Resources.PidsLimit = pidsLimit h.Resources.Memory = 4092 * Megabyte t := true h.Resources.OomKillDisable = &t diff --git a/www/welcome.html b/www/welcome.html index efa55cc..c28c65e 100644 --- a/www/welcome.html +++ b/www/welcome.html @@ -13,7 +13,7 @@

Before starting we need to verify you are a human

- +