Skip to content

Commit

Permalink
Merge pull request #30 from k1LoW/set-worker-processes
Browse files Browse the repository at this point in the history
Set the number of CPUs to worker_processs
  • Loading branch information
k1LoW authored Oct 13, 2023
2 parents 1794b9f + df0f309 commit 5f2e8fc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions testutil/container.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"net/url"
"os"
"path/filepath"
"runtime"
"testing"
"text/template"

Expand Down Expand Up @@ -34,6 +35,7 @@ func NewReverseProxyNGINXServer(t testing.TB, hostname string, upstreams map[str
t.Fatal(err)
}
if err := tmpl.Execute(f, map[string]any{
"NumCPU": runtime.NumCPU(),
"Hostname": hostname,
"Upstreams": upstreams,
}); err != nil {
Expand Down
2 changes: 1 addition & 1 deletion testutil/templates/nginx_reverse.conf.tmpl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
worker_processes 1;
worker_processes {{ .NumCPU }};

events {
worker_connections 1024;
Expand Down

0 comments on commit 5f2e8fc

Please sign in to comment.