From 83aac4bdfe5a794d8d28210a9c74934f8abb31c5 Mon Sep 17 00:00:00 2001 From: grac3gao Date: Fri, 4 Oct 2019 15:13:16 -0700 Subject: [PATCH 1/5] channel imc perf test --- .../continuous/100-channel-imc-setup.yaml | 103 +++++++++++++ .../continuous/200-channel-imc.yaml | 135 ++++++++++++++++++ 2 files changed, 238 insertions(+) create mode 100644 test/performance/channel-imc/continuous/100-channel-imc-setup.yaml create mode 100644 test/performance/channel-imc/continuous/200-channel-imc.yaml diff --git a/test/performance/channel-imc/continuous/100-channel-imc-setup.yaml b/test/performance/channel-imc/continuous/100-channel-imc-setup.yaml new file mode 100644 index 00000000000..cdb48c12e1a --- /dev/null +++ b/test/performance/channel-imc/continuous/100-channel-imc-setup.yaml @@ -0,0 +1,103 @@ +# Copyright 2019 The Knative Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +--- + +apiVersion: v1 +kind: Service +metadata: + name: channel-imc-consumer + namespace: default +spec: + selector: + role: channel-imc-consumer + ports: + - protocol: TCP + port: 80 + targetPort: cloudevents + name: http + +--- + +apiVersion: v1 +kind: Service +metadata: + name: channel-imc-aggregator + namespace: default +spec: + selector: + role: channel-imc-aggregator + ports: + - name: grpc + port: 10000 + targetPort: grpc + protocol: TCP + +--- + +apiVersion: v1 +kind: ServiceAccount +metadata: + name: perf-eventing + namespace: default + +--- + +kind: ClusterRole +apiVersion: rbac.authorization.k8s.io/v1 +metadata: + name: perf-eventing +rules: + - apiGroups: [""] + resources: ["nodes", "pods"] + verbs: ["list"] + +--- + +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: perf-eventing +subjects: + - kind: ServiceAccount + name: perf-eventing + namespace: default +roleRef: + kind: ClusterRole + name: perf-eventing + apiGroup: rbac.authorization.k8s.io + +--- + +apiVersion: messaging.knative.dev/v1alpha1 +kind: InMemoryChannel +metadata: + name: channel-imc + namespace: default + +--- + + +apiVersion: eventing.knative.dev/v1alpha1 +kind: Subscription +metadata: + name: channel-imc-sub + namespace: default +spec: + channel: + apiVersion: messaging.knative.dev/v1alpha1 + kind: InMemoryChannel + name: channel-imc + subscriber: + uri: "http://channel-imc-consumer.default.svc.cluster.local" diff --git a/test/performance/channel-imc/continuous/200-channel-imc.yaml b/test/performance/channel-imc/continuous/200-channel-imc.yaml new file mode 100644 index 00000000000..deb08a9337c --- /dev/null +++ b/test/performance/channel-imc/continuous/200-channel-imc.yaml @@ -0,0 +1,135 @@ +# Copyright 2019 The Knative Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +apiVersion: batch/v1beta1 +kind: CronJob +metadata: + name: channel-imc-send-receive + namespace: default + labels: + role: channel-imc-consumer +spec: + schedule: "0/15 * * * *" + # History must be zero to ensure no failed pods stick around and block the next job + successfulJobsHistoryLimit: 0 + failedJobsHistoryLimit: 0 + jobTemplate: + spec: + completions: 1 + parallelism: 1 + backoffLimit: 0 + # Allow up to 14 minutes, then clean up to make room for the next attempt + activeDeadlineSeconds: 840 + template: + metadata: + labels: + role: channel-imc-consumer + spec: + serviceAccountName: perf-eventing + restartPolicy: Never + containers: + - name: sender-receiver + image: knative.dev/eventing/test/test_images/performance + args: + - "--role=sender-receiver" + - "--sink=http://channel-imc-kn-channel.default.svc.cluster.local" + - "--aggregator=channel-imc-aggregator:10000" + - "--pace=100:10,400:20,800:30,1000:60" + - "--verbose" + env: + - name: GOGC + value: "off" + - name: POD_NAME + valueFrom: + fieldRef: + fieldPath: metadata.name + - name: POD_NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace + resources: + requests: + cpu: 1000m + memory: 6Gi + ports: + - name: cloudevents + containerPort: 8080 + +--- + +apiVersion: batch/v1beta1 +kind: CronJob +metadata: + name: channel-imc-aggregator + namespace: default + labels: + role: channel-imc-aggregator +spec: + schedule: "0/15 * * * *" + # History must be zero to ensure no failed pods stick around and block the next job + successfulJobsHistoryLimit: 0 + failedJobsHistoryLimit: 0 + jobTemplate: + spec: + completions: 1 + parallelism: 1 + backoffLimit: 0 + # Allow up to 14 minutes, then clean up to make room for the next attempt + activeDeadlineSeconds: 840 + template: + metadata: + labels: + role: channel-imc-aggregator + spec: + serviceAccountName: perf-eventing + restartPolicy: Never + containers: + - name: aggregator + image: knative.dev/eventing/test/test_images/performance + args: + - "--role=aggregator" + # set to the number of sender-receiver + - "--expect-records=1" + - "--mako-tags=channel=imc" + - "--verbose" + ports: + - name: grpc + containerPort: 10000 + resources: + requests: + cpu: 1000m + memory: 2Gi + volumeMounts: + - name: config-mako + mountPath: /etc/config-mako + terminationMessagePolicy: FallbackToLogsOnError + - name: mako + image: gcr.io/knative-performance/mako-microservice:latest + env: + - name: GOOGLE_APPLICATION_CREDENTIALS + value: /var/secret/robot.json + volumeMounts: + - name: service-account + mountPath: /var/secret + ports: + - name: quickstore + containerPort: 9813 + terminationMessagePolicy: FallbackToLogsOnError + volumes: + - name: config-mako + configMap: + name: config-mako + - name: service-account + secret: + secretName: service-account From d4b741691ed63b47b05d9163805f97645d84271a Mon Sep 17 00:00:00 2001 From: grac3gao Date: Mon, 7 Oct 2019 13:41:56 -0700 Subject: [PATCH 2/5] channel perf test --- test/performance/channel-imc/100-channel-perf-setup.yaml | 2 +- .../channel-imc/continuous/100-channel-imc-setup.yaml | 2 +- test/performance/channel-imc/continuous/200-channel-imc.yaml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/test/performance/channel-imc/100-channel-perf-setup.yaml b/test/performance/channel-imc/100-channel-perf-setup.yaml index 8cd660fe8a5..afff1bfc634 100644 --- a/test/performance/channel-imc/100-channel-perf-setup.yaml +++ b/test/performance/channel-imc/100-channel-perf-setup.yaml @@ -131,7 +131,7 @@ metadata: --- -apiVersion: eventing.knative.dev/v1alpha1 +apiVersion: messaging.knative.dev/v1alpha1 kind: Subscription metadata: name: in-memory-test-channel-sub diff --git a/test/performance/channel-imc/continuous/100-channel-imc-setup.yaml b/test/performance/channel-imc/continuous/100-channel-imc-setup.yaml index cdb48c12e1a..c91e2d37614 100644 --- a/test/performance/channel-imc/continuous/100-channel-imc-setup.yaml +++ b/test/performance/channel-imc/continuous/100-channel-imc-setup.yaml @@ -89,7 +89,7 @@ metadata: --- -apiVersion: eventing.knative.dev/v1alpha1 +apiVersion: messaging.knative.dev/v1alpha1 kind: Subscription metadata: name: channel-imc-sub diff --git a/test/performance/channel-imc/continuous/200-channel-imc.yaml b/test/performance/channel-imc/continuous/200-channel-imc.yaml index deb08a9337c..535839d9fca 100644 --- a/test/performance/channel-imc/continuous/200-channel-imc.yaml +++ b/test/performance/channel-imc/continuous/200-channel-imc.yaml @@ -45,7 +45,7 @@ spec: - "--role=sender-receiver" - "--sink=http://channel-imc-kn-channel.default.svc.cluster.local" - "--aggregator=channel-imc-aggregator:10000" - - "--pace=100:10,400:20,800:30,1000:60" + - "--pace=100:10,400:20,800:30,1000:60,2000:60,3000:60" - "--verbose" env: - name: GOGC From 89cc033e076ceea10dfc03421212f10389d7c297 Mon Sep 17 00:00:00 2001 From: grac3gao Date: Tue, 8 Oct 2019 13:56:36 -0700 Subject: [PATCH 3/5] perf test for channel --- test/performance/broker-imc/dev.config | 4 +- .../continuous/200-channel-imc.yaml | 2 + test/performance/channel-imc/dev.config | 61 +++++++++++++++++++ 3 files changed, 65 insertions(+), 2 deletions(-) create mode 100644 test/performance/channel-imc/dev.config diff --git a/test/performance/broker-imc/dev.config b/test/performance/broker-imc/dev.config index f847c2986ee..f73d1b09600 100644 --- a/test/performance/broker-imc/dev.config +++ b/test/performance/broker-imc/dev.config @@ -1,7 +1,7 @@ ### Creating this benchmark: -# mako create_benchmark test/performance/broker-latency/dev.config +# mako create_benchmark test/performance/broker-imc/dev.config ### Updating this benchmark: -# mako update_benchmark test/performance/broker-latency/dev.config +# mako update_benchmark test/performance/broker-imc/dev.config project_name: "Knative" benchmark_name: "Development - Broker Latency & Throughput" diff --git a/test/performance/channel-imc/continuous/200-channel-imc.yaml b/test/performance/channel-imc/continuous/200-channel-imc.yaml index 535839d9fca..d64c4d94f5f 100644 --- a/test/performance/channel-imc/continuous/200-channel-imc.yaml +++ b/test/performance/channel-imc/continuous/200-channel-imc.yaml @@ -103,6 +103,8 @@ spec: - "--expect-records=1" - "--mako-tags=channel=imc" - "--verbose" + - "--benchmark-key=5683818216292352" + - "--benchmark-name=Development - Channel Latency & Throughput" ports: - name: grpc containerPort: 10000 diff --git a/test/performance/channel-imc/dev.config b/test/performance/channel-imc/dev.config new file mode 100644 index 00000000000..321e5d3435c --- /dev/null +++ b/test/performance/channel-imc/dev.config @@ -0,0 +1,61 @@ +### Creating this benchmark: +# mako create_benchmark test/performance/channel-imc/dev.config +### Updating this benchmark: +# mako update_benchmark test/performance/channel-imc/dev.config + +project_name: "Knative" +benchmark_name: "Development - Channel Latency & Throughput" +description: "Measure latency and throughput of channels." +benchmark_key: '5683818216292352' + +# Human owners for manual benchmark adjustments. +owner_list: "grantrodgers@google.com" +owner_list: "chizhg@google.com" +owner_list: "xiyue@google.com" +owner_list: "gracegao@google.com" +owner_list: "nachocano@google.com" + +# Anyone can add their IAM robot here to publish to this benchmark. +owner_list: "mako-job@knative-eventing-performance.iam.gserviceaccount.com" +# This is grantrodgers' robot: +owner_list: "mako-upload@grantrodgers-crd.iam.gserviceaccount.com" +owner_list: "mako-upload@xiyue-knative-project.iam.gserviceaccount.com" +owner_list: "mako-upload@gracegao-knative-gcp-testing.iam.gserviceaccount.com" +owner_list: "mako-upload@knative-project-228222.iam.gserviceaccount.com" + +# Define the name and type for x-axis of run charts +input_value_info: { + value_key: "t" + label: "time" + type: TIMESTAMP +} + +# Note: value_key is stored repeatedly and should be very short (ideally one or two characters). +metric_info_list: { + value_key: "pl" + label: "publish-latency" +} +metric_info_list: { + value_key: "pe" + label: "publish-errors" +} +metric_info_list: { + value_key: "st" + label: "send-throughput" +} +metric_info_list: { + value_key: "dl" + label: "deliver-latency" +} +metric_info_list: { + value_key: "de" + label: "deliver-errors" +} +metric_info_list: { + value_key: "dt" + label: "deliver-throughput" +} +metric_info_list: { + value_key: "ft" + label: "failure-throughput" +} From 544a271d6f1ccfbe51c705d4648478b4ce766ab1 Mon Sep 17 00:00:00 2001 From: grac3gao Date: Tue, 8 Oct 2019 17:48:05 -0700 Subject: [PATCH 4/5] perf test for channel - 2 --- .../channel-imc/continuous/100-channel-imc-setup.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/performance/channel-imc/continuous/100-channel-imc-setup.yaml b/test/performance/channel-imc/continuous/100-channel-imc-setup.yaml index c91e2d37614..fcb589f8c65 100644 --- a/test/performance/channel-imc/continuous/100-channel-imc-setup.yaml +++ b/test/performance/channel-imc/continuous/100-channel-imc-setup.yaml @@ -100,4 +100,7 @@ spec: kind: InMemoryChannel name: channel-imc subscriber: - uri: "http://channel-imc-consumer.default.svc.cluster.local" + ref: + apiVersion: v1 + kind: Service + name: channel-imc-consumer From d13929aa70c7ef9dc2fd50a7258f1b8f7c4c5a53 Mon Sep 17 00:00:00 2001 From: grac3gao Date: Tue, 15 Oct 2019 11:38:02 -0700 Subject: [PATCH 5/5] Code change --- test/performance/channel-imc/continuous/200-channel-imc.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/performance/channel-imc/continuous/200-channel-imc.yaml b/test/performance/channel-imc/continuous/200-channel-imc.yaml index d64c4d94f5f..ed18118991a 100644 --- a/test/performance/channel-imc/continuous/200-channel-imc.yaml +++ b/test/performance/channel-imc/continuous/200-channel-imc.yaml @@ -42,7 +42,7 @@ spec: - name: sender-receiver image: knative.dev/eventing/test/test_images/performance args: - - "--role=sender-receiver" + - "--roles=sender,receiver" - "--sink=http://channel-imc-kn-channel.default.svc.cluster.local" - "--aggregator=channel-imc-aggregator:10000" - "--pace=100:10,400:20,800:30,1000:60,2000:60,3000:60" @@ -100,7 +100,7 @@ spec: args: - "--role=aggregator" # set to the number of sender-receiver - - "--expect-records=1" + - "--expect-records=2" - "--mako-tags=channel=imc" - "--verbose" - "--benchmark-key=5683818216292352"