mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
Kubernetes benchmarks: Reduce cardinality for server-based benchmarks.
This makes the benchmarks quicker to run. PiperOrigin-RevId: 706150034
This commit is contained in:
committed by
gVisor bot
parent
c27c9a02ae
commit
036c9d47d1
@@ -20,6 +20,7 @@ import (
|
||||
"path"
|
||||
"strings"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
k8s "gvisor.dev/gvisor/test/kubernetes"
|
||||
"gvisor.dev/gvisor/test/kubernetes/benchmarks/profiling"
|
||||
@@ -127,7 +128,9 @@ func BuildGRPC(ctx context.Context, t *testing.T, k8sCtx k8sctx.KubernetesContex
|
||||
if err != nil {
|
||||
t.Fatalf("Failed to initialize benchmark recorder: %v", err)
|
||||
}
|
||||
containerDuration, err := benchmetric.GetTimedContainerDuration(ctx, cluster, pod, name)
|
||||
waitDeadlineCtx, cancel := context.WithTimeout(ctx, 30*time.Minute)
|
||||
containerDuration, err := benchmetric.GetTimedContainerDuration(waitDeadlineCtx, cluster, pod, name)
|
||||
cancel()
|
||||
if err != nil {
|
||||
t.Fatalf("Failed to get container duration: %v", err)
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ import (
|
||||
|
||||
const (
|
||||
nginxPort = 80
|
||||
nginxBenchmarkDuration = 70 * time.Second
|
||||
nginxBenchmarkDuration = 55 * time.Second
|
||||
nginxRequestTimeout = 3 * time.Second
|
||||
nginxServingDir = "/tmp/html"
|
||||
|
||||
@@ -48,9 +48,9 @@ var (
|
||||
// The test expects that it contains the files to be served at /local,
|
||||
// and will serve files out of `nginxServingDir`.
|
||||
nginxCommand = []string{"nginx", "-c", "/etc/nginx/nginx.conf"}
|
||||
nginxDocKibibytes = []int{1, 10, 100, 10240}
|
||||
threads = []int{1, 8, 64, 1000}
|
||||
targetQPS = []int{1, 8, 64, httpbench.InfiniteQPS}
|
||||
nginxDocKibibytes = []int{1, 10240}
|
||||
threads = []int{1, 8, 1000}
|
||||
targetQPS = []int{1, 64, httpbench.InfiniteQPS}
|
||||
wantPercentiles = []int{50, 95, 99}
|
||||
)
|
||||
|
||||
@@ -182,20 +182,6 @@ func BenchmarkNginx(ctx context.Context, t *testing.T, k8sCtx k8sctx.KubernetesC
|
||||
}
|
||||
}
|
||||
|
||||
t.Run("0KiB", func(t *testing.T) {
|
||||
benchmark := &httpbench.HTTPBenchmark{
|
||||
Name: fmt.Sprintf("nginx/%s/0KiB", test.name),
|
||||
Cluster: cluster,
|
||||
Namespace: benchmarkNS,
|
||||
Service: service,
|
||||
Port: nginxPort,
|
||||
Path: "/index.html",
|
||||
Rounds: rounds,
|
||||
Timeout: nginxRequestTimeout,
|
||||
WantPercentiles: wantPercentiles,
|
||||
}
|
||||
benchmark.Run(ctx, t)
|
||||
})
|
||||
for _, docKibibytes := range nginxDocKibibytes {
|
||||
t.Run(fmt.Sprintf("%dKiB", docKibibytes), func(t *testing.T) {
|
||||
benchmark := &httpbench.HTTPBenchmark{
|
||||
@@ -212,20 +198,6 @@ func BenchmarkNginx(ctx context.Context, t *testing.T, k8sCtx k8sctx.KubernetesC
|
||||
benchmark.Run(ctx, t)
|
||||
})
|
||||
}
|
||||
t.Run("HTTP404", func(t *testing.T) {
|
||||
benchmark := &httpbench.HTTPBenchmark{
|
||||
Name: fmt.Sprintf("nginx/%s/HTTP404", test.name),
|
||||
Cluster: cluster,
|
||||
Namespace: benchmarkNS,
|
||||
Service: service,
|
||||
Port: nginxPort,
|
||||
Path: "/404-this-page-does-not-exist.html",
|
||||
Rounds: rounds,
|
||||
Timeout: nginxRequestTimeout,
|
||||
WantPercentiles: wantPercentiles,
|
||||
}
|
||||
benchmark.Run(ctx, t)
|
||||
})
|
||||
})
|
||||
if t.Failed() {
|
||||
break
|
||||
|
||||
@@ -46,7 +46,7 @@ const (
|
||||
)
|
||||
|
||||
var (
|
||||
numConnections = []int{1, 2, 6, 16, 32, 64}
|
||||
numConnections = []int{1, 2, 12, 64}
|
||||
)
|
||||
|
||||
// BenchmarkPostgresPGBench runs a PostgreSQL pgbench test.
|
||||
|
||||
@@ -49,9 +49,9 @@ const (
|
||||
)
|
||||
|
||||
var (
|
||||
numConnections = []int{1, 2, 4, 8, 16, 32}
|
||||
numConnections = []int{1, 4, 32}
|
||||
latencyPercentiles = []int{50, 95, 99}
|
||||
operations = []string{"SET", "GET", "MSET", "LPUSH", "LRANGE_500"}
|
||||
operations = []string{"GET", "MSET", "LRANGE_500"}
|
||||
)
|
||||
|
||||
// BenchmarkRedis runs the Redis performance benchmark using redis-benchmark.
|
||||
|
||||
@@ -35,7 +35,7 @@ const (
|
||||
mariaDBImage = "mariadb:10.11.3-jammy"
|
||||
wordpressPort = 80
|
||||
mariaDBPort = 3306
|
||||
wordpressBenchmarkDuration = 70 * time.Second
|
||||
wordpressBenchmarkDuration = 55 * time.Second
|
||||
wordpressRequestTimeout = 10 * time.Second
|
||||
wordpressLoginPage = "/wp-login.php"
|
||||
mariaDBName = "wpbench"
|
||||
@@ -52,8 +52,8 @@ const (
|
||||
)
|
||||
|
||||
var (
|
||||
threads = []int{1, 8, 64, 1000}
|
||||
targetQPS = []int{1, 8, 64, httpbench.InfiniteQPS}
|
||||
threads = []int{1, 8, 1000}
|
||||
targetQPS = []int{1, 64, httpbench.InfiniteQPS}
|
||||
wantPercentiles = []int{50, 95, 99}
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user