summaryrefslogtreecommitdiffhomepage
path: root/cmd
diff options
context:
space:
mode:
authorKévin Dunglas <[email protected]>2023-12-18 23:50:26 +0100
committerGitHub <[email protected]>2023-12-18 15:50:26 -0700
commitd54dcf1598f87aa1e9757c5d90debf04ae4b1916 (patch)
treebf521fb0a27eb710a1212277b49b68fb592b501f /cmd
parent3248e4c89f510ad832bc9fb0ed6f6b945355304d (diff)
downloadcaddy-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.go10
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()
}