Skip to content

Commit

Permalink
Ability to trigger multiple procs from the same client
Browse files Browse the repository at this point in the history
Signed-off-by: Raul Sevilla <[email protected]>
  • Loading branch information
rsevilla87 committed Jul 20, 2023
1 parent 1f435ae commit 84bcbf9
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 10 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 @@ -79,8 +79,10 @@ func runBenchmark(cfg config.Config, clusterMetadata ocpmetadata.ClusterMetadata
}
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 @@ -162,10 +164,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
}
3 changes: 2 additions & 1 deletion pkg/runner/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,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 84bcbf9

Please sign in to comment.