Skip to content

Commit

Permalink
Increase pidslimit to 1000 and allow to override via env var
Browse files Browse the repository at this point in the history
  • Loading branch information
marcosnils committed Feb 1, 2017
1 parent c0bafc5 commit 434256f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
10 changes: 9 additions & 1 deletion services/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"io"
"log"
"os"
"strconv"
"strings"

"github.com/docker/docker/api/types"
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion www/welcome.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ <h1>Welcome!</h1>
<h2>Before starting we need to verify you are a human</h2>
<form id="welcomeForm" method="POST" action="/">
<div class="g-recaptcha" data-callback="iAmHuman" data-sitekey="{{.}}"></div>
<input type="hidden" name="session-duration" value="1h"/>
<input type="hidden" name="session-duration" value="4h"/>
</form>
<img src="/assets/large_h.png" />
</div>
Expand Down

0 comments on commit 434256f

Please sign in to comment.