cmd: use automaxprocs for better perf in containers (#5711)

* feat: use automaxprocs for better perf in containers

* better logs

* cs
This commit is contained in:
Kévin Dunglas 2023-12-18 23:50:26 +01:00 committed by GitHub
parent 3248e4c89f
commit d54dcf1598
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 0 deletions

View file

@ -29,12 +29,22 @@
package main
import (
"go.uber.org/automaxprocs/maxprocs"
"go.uber.org/zap"
caddycmd "github.com/caddyserver/caddy/v2/cmd"
"github.com/caddyserver/caddy/v2"
// plug in Caddy modules here
_ "github.com/caddyserver/caddy/v2/modules/standard"
)
func main() {
undo, err := maxprocs.Set()
defer undo()
if err != nil {
caddy.Log().Warn("failed to set GOMAXPROCS", zap.Error(err))
}
caddycmd.Main()
}