Skip to content

Commit

Permalink
feat/perf-test: update README and broker-imc benchmark (#4607)
Browse files Browse the repository at this point in the history
* feat/perf-test: update README and broker-imc benchmark

* Resolve comments
  • Loading branch information
Zhongduo Lin (Jimmy) authored Dec 8, 2020
1 parent d3bff1f commit ca2def5
Show file tree
Hide file tree
Showing 7 changed files with 48 additions and 11 deletions.
23 changes: 14 additions & 9 deletions test/performance/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,24 @@

## Configuring your cluster to run a benchmark

1. Create a namespace or use an existing namespace. Each namespace can be
configured with a single benchmark.
1. Create a namespace `perf-eventing` if it does not exist. To use a different
namespace, please replace all the namespaces in
all bash commands and yaml configuration files with your choice.

1. Install Knative eventing by following the steps in
https://github.com/knative/eventing/blob/2c6bf0526634804b7ebeee686445901440cc8edd/test/performance/performance-tests.sh#L31
1. Install Knative eventing and components used in the performance test,
such as MT broker, by following the steps in https://github.com/knative/eventing/blob/master/DEVELOPMENT.md.

1. Create a ConfigMap called `config-mako` in your chosen namespace containing
the Mako config file.

```
kubectl create configmap -n <namespace> config-mako --from-file=test/performance/benchmarks/<benchmark>/dev.config
kubectl create configmap -n perf-eventing config-mako --from-file=test/performance/benchmarks/<benchmark>/dev.config
```

1. Optionally edit the ConfigMap to set additional keys.

```
kubectl edit configmap -n <namespace> config-mako
kubectl edit configmap -n perf-eventing config-mako
```

[`NewConfigFromMap`](https://github.com/knative/pkg/blob/master/test/mako/config.go#L41)
Expand Down Expand Up @@ -55,14 +56,18 @@ To run a benchmark once, and use the result from `mako-stub` for plotting:
ko apply -f test/performance/benchmarks/broker-imc/200-broker-perf.yaml
```

1. Wait until all the pods in namespace `perf-eventing` are completed.

1. Retrieve results from mako-stub using the script in
[knative/pkg](https://github.com/knative/pkg/blob/master/test/mako/stub-sidecar/read_results.sh):
[knative/pkg](https://github.com/knative/pkg/blob/master/test/mako/stub-sidecar/read_results.sh)
where `pod_name` is the name of the aggregator pod:

```
bash "$GOPATH/src/knative.dev/pkg/test/mako/stub-sidecar/read_results.sh" "$pod_name" perf-eventing ${mako_port:-10001} ${timeout:-120} ${retries:-100} ${retries_interval:-10} "$output_file"
bash "$GOPATH/src/knative.dev/eventing/vendor/knative.dev/pkg/test/mako/stub-sidecar/read_results.sh" "$pod_name" perf-eventing ${mako_port:-10001} ${timeout:-120} ${retries:-100} ${retries_interval:-10} "$output_file"
```

This will download a CSV with all raw results.
This will download a CSV with all raw results. Alternatively you can remove the port argument
`-p` in `mako-stub` container to dump the output to container log directly.

## Available benchmarks

Expand Down
15 changes: 14 additions & 1 deletion test/performance/benchmarks/broker-imc/200-broker-perf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ spec:
image: ko://knative.dev/eventing/test/test_images/performance
args:
- "--roles=sender,receiver"
- "--sink=http://in-memory-test-broker-broker.perf-eventing.svc.cluster.local"
- "--sink=http://broker-ingress.knative-eventing.svc.cluster.local/perf-eventing/in-memory-test-broker"
- "--aggregator=broker-perf-aggregator:10000"
- "--pace=500:30,600:30,700:30,800:30,900:30,1000:30"
env:
Expand Down Expand Up @@ -76,6 +76,17 @@ spec:
- "--roles=aggregator"
# set to the number of sender + receiver (same image that does both counts 2)
- "--expect-records=2"
env:
- name: GOGC
value: "off"
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: POD_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
ports:
- name: grpc
containerPort: 10000
Expand All @@ -89,6 +100,8 @@ spec:
terminationMessagePolicy: FallbackToLogsOnError
- name: mako-stub
image: ko://knative.dev/pkg/test/mako/stub-sidecar
args:
- "-p=10001"
ports:
- name: quickstore
containerPort: 9813
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,12 @@ spec:
image: ko://knative.dev/eventing/test/test_images/performance
args:
- "--roles=sender"
- "--sink=http://imc-broker.default.svc.cluster.local"
- "--sink=http://broker-ingress.knative-eventing.svc.cluster.local/perf-eventing/in-memory-test-broker"
- "--aggregator=broker-imc-aggregator:10000"
- "--pace=100:10,400:20,800:30,900:60,1000:60,1100:60,1200:60"
env:
- name: GOGC
value: "off"
- name: POD_NAME
valueFrom:
fieldRef:
Expand Down Expand Up @@ -114,6 +116,17 @@ spec:
# set to the number of sender + receiver (same image that does both counts 2)
- "--expect-records=2"
- "--mako-tags=channel=imc"
env:
- name: GOGC
value: "off"
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: POD_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
ports:
- name: grpc
containerPort: 10000
Expand Down
2 changes: 2 additions & 0 deletions test/performance/benchmarks/broker-imc/dev.config
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ owner_list: "gracegao@google.com"
owner_list: "nachocano@google.com"
owner_list: "cshou@google.com"
owner_list: "ngiraldo@google.com"
owner_list: "zhongduo@google.com"

# GCP Service Accounts that can publish data to Mako.
owner_list: "mako-job@knative-performance.iam.gserviceaccount.com"
Expand All @@ -25,6 +26,7 @@ owner_list: "mako-upload@gracegao-knative-gcp-testing.iam.gserviceaccount.com"
owner_list: "mako-upload@knative-project-228222.iam.gserviceaccount.com"
owner_list: "mako-upload@cshou-playground.iam.gserviceaccount.com"
owner_list: "mako-upload@ngiraldo-knative-dev.iam.gserviceaccount.com"
owner_list: "mako-upload@jimmy-knative-dev.iam.gserviceaccount.com"

# Define the name and type for x-axis of run charts
input_value_info: {
Expand Down
1 change: 1 addition & 0 deletions test/performance/benchmarks/broker-imc/prod.config
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ owner_list: "gracegao@google.com"
owner_list: "nachocano@google.com"
owner_list: "cshou@google.com"
owner_list: "ngiraldo@google.com"
owner_list: "zhongduo@google.com"

# GCP Service Accounts that can publish data to Mako. Since this is a prod
# benchmark, only the CI account should be listed here.
Expand Down
2 changes: 2 additions & 0 deletions test/performance/benchmarks/channel-imc/dev.config
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ owner_list: "gracegao@google.com"
owner_list: "nachocano@google.com"
owner_list: "cshou@google.com"
owner_list: "ngiraldo@google.com"
owner_list: "zhongduo@google.com"

# GCP Service Accounts that can publish data to Mako.
owner_list: "mako-job@knative-performance.iam.gserviceaccount.com"
Expand All @@ -25,6 +26,7 @@ owner_list: "mako-upload@gracegao-knative-gcp-testing.iam.gserviceaccount.com"
owner_list: "mako-upload@knative-project-228222.iam.gserviceaccount.com"
owner_list: "mako-upload@cshou-playground.iam.gserviceaccount.com"
owner_list: "mako-upload@ngiraldo-knative-dev.iam.gserviceaccount.com"
owner_list: "mako-upload@jimmy-knative-dev.iam.gserviceaccount.com"

# Define the name and type for x-axis of run charts
input_value_info: {
Expand Down
1 change: 1 addition & 0 deletions test/performance/benchmarks/channel-imc/prod.config
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ owner_list: "gracegao@google.com"
owner_list: "nachocano@google.com"
owner_list: "cshou@google.com"
owner_list: "ngiraldo@google.com"
owner_list: "zhongduo@google.com"

# GCP Service Accounts that can publish data to Mako. Since this is a prod
# benchmark, only the CI account should be listed here.
Expand Down

0 comments on commit ca2def5

Please sign in to comment.