mirror of https://github.com/docker/docs.git
Increase max thread count to 50k
Signed-off-by: Dong Chen <dongluo.chen@docker.com>
This commit is contained in:
parent
e24cc12814
commit
408f3cff8e
11
cli/cli.go
11
cli/cli.go
|
@ -4,6 +4,7 @@ import (
|
|||
"fmt"
|
||||
"os"
|
||||
"path"
|
||||
"runtime/debug"
|
||||
|
||||
log "github.com/Sirupsen/logrus"
|
||||
"github.com/codegangsta/cli"
|
||||
|
@ -13,6 +14,8 @@ import (
|
|||
|
||||
// Run the Swarm CLI.
|
||||
func Run() {
|
||||
setProgramLimits()
|
||||
|
||||
app := cli.NewApp()
|
||||
app.Name = path.Base(os.Args[0])
|
||||
app.Usage = "A Docker-native clustering system"
|
||||
|
@ -66,3 +69,11 @@ func Run() {
|
|||
log.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
||||
func setProgramLimits() {
|
||||
// Swarm runnable threads could be large when the number of nodes is large
|
||||
// or under request bursts. Most threads are occupied by network connections.
|
||||
// Increase max thread count from 10k default to 50k to accommodate it.
|
||||
const maxThreadCount int = 50 * 1000
|
||||
debug.SetMaxThreads(maxThreadCount)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue