diff options
author | Kévin Dunglas <[email protected]> | 2023-12-18 23:50:26 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2023-12-18 15:50:26 -0700 |
commit | d54dcf1598f87aa1e9757c5d90debf04ae4b1916 (patch) | |
tree | bf521fb0a27eb710a1212277b49b68fb592b501f /cmd | |
parent | 3248e4c89f510ad832bc9fb0ed6f6b945355304d (diff) | |
download | caddy-d54dcf1598f87aa1e9757c5d90debf04ae4b1916.tar.gz caddy-d54dcf1598f87aa1e9757c5d90debf04ae4b1916.zip |
cmd: use automaxprocs for better perf in containers (#5711)
* feat: use automaxprocs for better perf in containers
* better logs
* cs
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/caddy/main.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/cmd/caddy/main.go b/cmd/caddy/main.go index 48fa149aa..e361e3bef 100644 --- a/cmd/caddy/main.go +++ b/cmd/caddy/main.go @@ -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() } |