mirror of
https://github.com/caddyserver/caddy.git
synced 2025-03-21 11:02:36 +03:00
comments
This commit is contained in:
parent
9cf85c8771
commit
66e06dc2a9
1 changed files with 4 additions and 0 deletions
|
@ -69,12 +69,16 @@ func Main() {
|
|||
os.Exit(caddy.ExitCodeFailedStartup)
|
||||
}
|
||||
|
||||
// Configure the maximum number of CPUs to use to match the Linux container quota (if any)
|
||||
// See https://pkg.go.dev/runtime#GOMAXPROCS
|
||||
undo, err := maxprocs.Set()
|
||||
defer undo()
|
||||
if err != nil {
|
||||
caddy.Log().Warn("failed to set GOMAXPROCS", zap.Error(err))
|
||||
}
|
||||
|
||||
// Configure the maximum memory to use to match the Linux container quota (if any) or system memory
|
||||
// See https://pkg.go.dev/runtime/debug#SetMemoryLimit
|
||||
_, _ = memlimit.SetGoMemLimitWithOpts(
|
||||
memlimit.WithLogger(
|
||||
slog.New(zapslog.NewHandler(caddy.Log().Core())),
|
||||
|
|
Loading…
Reference in a new issue