Skip to content

Commit

Permalink
Merge branch 'main' into version-branch
Browse files Browse the repository at this point in the history
  • Loading branch information
krishvoor authored Jul 24, 2023
2 parents e68d9ce + 510d4ed commit dd50cb6
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 12 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Ingress-perf configuration is defined in a YAML file, holding an array of the fo
| `delay` | `time.Duration` | Defines a delay between samples. | `0s` |
| `warmup` | `bool` | Enables warmup: indexing will be disabled in this scenario. | `false` |
| `requestTimeout` | `time.Duration` | Request timeout | `1s` |
| `procs ` | `int` | Number of processes to trigger in each of the client pods | `1` |

## Supported tools

Expand Down
4 changes: 4 additions & 0 deletions config/standard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
tool: wrk
serverReplicas: 90
delay: 10s
procs: 2

- termination: edge
connections: 200
Expand All @@ -32,6 +33,7 @@
tool: wrk
serverReplicas: 90
delay: 10s
procs: 2

- termination: reencrypt
connections: 200
Expand All @@ -42,6 +44,7 @@
tool: wrk
serverReplicas: 90
delay: 10s
procs: 2

- termination: passthrough
connections: 200
Expand All @@ -52,6 +55,7 @@
tool: wrk
serverReplicas: 90
delay: 10s
procs: 2

- termination: http
connections: 200
Expand Down
1 change: 1 addition & 0 deletions pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ func (c *Config) UnmarshalYAML(unmarshal func(interface{}) error) error {
defaultCfg := ConfigDefaulted{
Warmup: false, // Disable warmup by default
RequestTimeout: time.Second,
Procs: 1,
}
if err := unmarshal(&defaultCfg); err != nil {
return err
Expand Down
4 changes: 3 additions & 1 deletion pkg/config/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,10 @@ type Config struct {
Duration time.Duration `yaml:"duration" json:"duration"`
// Path scenario endpoint. i.e: 1024.html, 2048.html
Path string `yaml:"path" json:"path"`
// Concurrency defined the number of clients
// Concurrency defines the number of clients
Concurrency int32 `yaml:"concurrency" json:"concurrency"`
// Procs processes per client pod
Procs int `yaml:"procs" json:"procs"`
// Tool defines the tool to run the benchmark scenario
Tool string `yaml:"tool" json:"tool"`
// ServerReplicas number of server (nginx) replicas backed by the routes. Example: wrk
Expand Down
19 changes: 11 additions & 8 deletions pkg/runner/exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,10 @@ func runBenchmark(cfg config.Config, clusterMetadata ocpmetadata.ClusterMetadata
result.Config.Tuning = currentTuning // It's usefult to index the current tunning configuration in the all benchmark's documents
log.Infof("Running sample %d/%d: %v", i, cfg.Samples, cfg.Duration)
for _, pod := range clientPods {
wg.Add(1)
go exec(context.TODO(), &wg, tool, pod, &result)
for i := 0; i < cfg.Procs; i++ {
wg.Add(1)
go exec(context.TODO(), &wg, tool, pod, &result)
}
}
wg.Wait()
genResultSummary(&result)
Expand Down Expand Up @@ -163,10 +165,11 @@ func genResultSummary(result *tools.Result) {
result.P95Latency += float64(pod.P95Latency)
result.P99Latency += float64(pod.P99Latency)
}
result.StdevRps = result.StdevRps / float64(len(result.Pods))
result.AvgLatency = result.AvgLatency / float64(len(result.Pods))
result.StdevLatency = result.StdevLatency / float64(len(result.Pods))
result.P90Latency = result.P90Latency / float64(len(result.Pods))
result.P95Latency = result.P95Latency / float64(len(result.Pods))
result.P99Latency = result.P99Latency / float64(len(result.Pods))
pods := float64(len(result.Pods))
result.StdevRps = result.StdevRps / pods
result.AvgLatency = result.AvgLatency / pods
result.StdevLatency = result.StdevLatency / pods
result.P90Latency = result.P90Latency / pods
result.P95Latency = result.P95Latency / pods
result.P99Latency = result.P99Latency / pods
}
7 changes: 4 additions & 3 deletions pkg/runner/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ func Start(uuid, baseUUID, baseIndex string, tolerancy int, indexer *indexers.In
if err != nil {
return err
}
restConfig.QPS = 50
restConfig.Burst = 50
restConfig.QPS = 200
restConfig.Burst = 200
clientSet = kubernetes.NewForConfigOrDie(restConfig)
orClientSet = openshiftrouteclientset.NewForConfigOrDie(restConfig)
dynamicClient = dynamic.NewForConfigOrDie(restConfig)
Expand All @@ -86,11 +86,12 @@ func Start(uuid, baseUUID, baseIndex string, tolerancy int, indexer *indexers.In
for i, cfg := range config.Cfg {
cfg.UUID = uuid
log.Infof("Running test %d/%d ", i+1, len(config.Cfg))
log.Infof("Tool:%s termination:%v servers:%d concurrency:%d connections:%d duration:%v",
log.Infof("Tool:%s termination:%v servers:%d concurrency:%d procs:%d connections:%d duration:%v",
cfg.Tool,
cfg.Termination,
cfg.ServerReplicas,
cfg.Concurrency,
cfg.Procs,
cfg.Connections,
cfg.Duration,
)
Expand Down

0 comments on commit dd50cb6

Please sign in to comment.