This version of the load tester can test subscription v1alpha2
only. For v1alpha1
we have a legacy branch.
This tool is used to generate continues load on the Eventing components.
It does that by sending Cloudevents to the Eventing publisher proxy forever and consume them inside Kyma functions.
Ideally, it should be used when JetStream is used as the active Eventing backend.
For testing against Legacy Events set use_legacy events
to true
. Leave it to false
to test against Cloud Events.
The load test will create:
- Two Kyma function subscribers.
- Two Kyma subscriptions.
Namespace | Subscription | Subscriber |
---|---|---|
eventing-test | subscription-0 | loadtest-subscriber-0 |
eventing-test | subscription-1 | loadtest-subscriber-1 |
Note: Each Kyma subscription is configured with
N
unique event types.
-
There are two event names:
- The
subscription-0
hasorder.created
. - The
subscription-1
hasorder.updated
.
- The
-
Events carry the
eps
information:
- EPS 50:
order.created.v0050
. - EPS 90: `order.created.v0090
Cloud Events have the eps
encoded at the end as part of the version
.
Legacy Events have the eps
body in the event-type
field of the body.
Note: Encoding the EPS in the event type version is used only for debugging purposes and is not a production use-case.
Command-line arguments:
Arguments | Description | Default |
---|---|---|
addr | The loadtest server address used by the Kubernetes liveness and readiness probes. | :8888 |
ConfigMap to change the loadtest behaviour at runtime:
Config | Description | Default |
---|---|---|
publish_endpoint | The Eventing publisher proxy cloudevents endpoint. | http://eventing-publisher-proxy.kyma-system/publish |
use_legacy_events: | Use legacy events or cloud events . |
false |
version_format: | The format string used to create a the event-version for both subscriptions. | v%04d |
max_inflight_messages_0 | The max inflight messages for the first subscription. | 10 |
max_inflight_messages_1 | The max inflight messages for the second subscription. | 10 |
event_name_0 | The event name used in the event-type for the first subscription. | order.created |
event_name_1 | The event name used in the event-type for the second subscription. | order.updated |
generate_count_0 | The number of event types to generate for the first subscription. | 1 |
generate_count_1 | The number of event types to generate for the second subscription. | 1 |
eps_start_0 | The EPS start for the first event type of the first subscription. | 1 |
eps_start_1 | The EPS start for the first event type of the second subscription. | 1 |
eps_increment_0 | The EPS increment for every event type (after the first) of the first subscription. | 1 |
eps_increment_1 | The EPS increment for every event type (after the first) of the second subscription. | 1 |
eps_limit | The EPS limit for the total publish requests sent in parallel. | 2000 |
workers | The number of workers to publish events in parallel. | 12 |
max_idle_conns | The maximum number of idle (keep-alive) connections across all hosts. Zero means no limit. | 100 |
max_conns_per_host | The the total number of connections per host limit. Zero means no limit. | 100 |
max_idle_conns_per_host | The maximum idle (keep-alive) connections to keep per-host. Zero means, use the default value which is 2. | 100 |
idle_conn_timeout | The maximum amount of time an idle (keep-alive) connection will remain idle before closing itself. Zero means no limit. | 1m0s |
- Connect to a Kubernetes cluster.
- Execute:
make loadtest-deploy
-
Update the loadtest ConfigMap values:
kubectl edit cm -n eventing-test loadtest
Note: After updating the loadtest-publisher ConfigMap, its behaviour will change automatically at runtime without the need to restart it.
This is useful in case we want to stop sending events to the Eventing publisher proxy, but preserve the Eventing
infrastructure inside the eventing-test
namespace.
-
Connect to a Kubernetes cluster.
-
Execute:
make loadtest-stop
Note: To continue sending events, deploy the loadtest again.
- Connect to a Kubernetes cluster.
- Loadtest logs:
stern -n eventing-test loadtest -c loadtest --since 1s
- Subscriber logs:
stern -n eventing-test sink -c function --since 1s | grep type
- Connect to a Kubernetes cluster.
- Execute:
make loadtest-delete
- Generate subscriptions in a more generic way. Instead of creating only
2
subscriptions, createN
subscriptions. - Implement a graceful shutdown to delete Kyma subscriptions in the
eventing-test
namespace when the loadtest receives a termination signal.