Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Put stress on a zeebe node #242

Merged
merged 2 commits into from
Nov 22, 2022
Merged

Put stress on a zeebe node #242

merged 2 commits into from
Nov 22, 2022

Conversation

ChrisKujawa
Copy link
Member

@ChrisKujawa ChrisKujawa commented Nov 21, 2022

Allow to put different kind of stress on a zeebe node (broker or gateway).

Stress types are CPU, IO and memory. The broker can be identified via nodeId or partitionId and role. For the gateway we choose the first one in the list as on all other commands.

Should replace https://github.com/zeebe-io/zeebe-chaos/blob/main/chaos-workers/chaos-experiments/scripts/stress-cpu.sh

close #238


Example:

Stress Broker:

$ ./zbchaos stress broker --cpu --memory --verbose
Connecting to zell-chaos
Running experiment in self-managed environment.
Successfully created port forwarding tunnel
Found Broker zell-chaos-zeebe-0 as LEADER for partition 1.
Put stress on zell-chaos-zeebe-0
Execute ["apt" "-qq" "update"] on pod zell-chaos-zeebe-0
7 packages can be upgraded. Run 'apt list --upgradable' to see them.
Execute ["apt" "-qq" "install" "-y" "stress" "procps"] on pod zell-chaos-zeebe-0
procps is already the newest version (2:3.3.16-1ubuntu2.3).
The following NEW packages will be installed:
  stress
0 upgraded, 1 newly installed, 0 to remove and 7 not upgraded.
Need to get 18.4 kB of archives.
After this operation, 55.3 kB of additional disk space will be used.
debconf: delaying package configuration, since apt-utils is not installed
Selecting previously unselected package stress.
(Reading database ... 7621 files and directories currently installed.)
Preparing to unpack .../stress_1.0.4-6_amd64.deb ...
Unpacking stress (1.0.4-6) ...
Setting up stress (1.0.4-6) ...
Execute ["stress" "--timeout" "30" "--cpu" "256" "--vm" "4"] on pod zell-chaos-zeebe-0
stress: info: [405] dispatching hogs: 256 cpu, 0 io, 4 vm, 0 hdd
stress: info: [405] successful run completed in 30s

Stress Gateway:

$ ./zbchaos stress gateway --cpu --verbose
Connecting to zell-chaos
Running experiment in self-managed environment.
Successfully created port forwarding tunnel
Put stress on zell-chaos-zeebe-gateway-58dc88cb5b-jz4lg
Execute ["apt" "-qq" "update"] on pod zell-chaos-zeebe-gateway-58dc88cb5b-jz4lg
7 packages can be upgraded. Run 'apt list --upgradable' to see them.
Execute ["apt" "-qq" "install" "-y" "stress" "procps"] on pod zell-chaos-zeebe-gateway-58dc88cb5b-jz4lg
procps is already the newest version (2:3.3.16-1ubuntu2.3).
The following NEW packages will be installed:
  stress
0 upgraded, 1 newly installed, 0 to remove and 7 not upgraded.
Need to get 18.4 kB of archives.
After this operation, 55.3 kB of additional disk space will be used.
debconf: delaying package configuration, since apt-utils is not installed
Selecting previously unselected package stress.
(Reading database ... 7621 files and directories currently installed.)
Preparing to unpack .../stress_1.0.4-6_amd64.deb ...
Unpacking stress (1.0.4-6) ...
Setting up stress (1.0.4-6) ...
Execute ["stress" "--timeout" "30" "--cpu" "256"] on pod zell-chaos-zeebe-gateway-58dc88cb5b-jz4lg
stress: info: [307] dispatching hogs: 256 cpu, 0 io, 0 vm, 0 hdd
stress: info: [307] successful run completed in 30s

Without verbose flag:

$ ./zbchaos stress gateway --cpu
Put stress on zell-chaos-zeebe-gateway-58dc88cb5b-jz4lg

Allow to put different kind of stress on a zeebe node (broker or gateway).

Stress types are CPU, IO and memory. The broker can be identified via nodeId or partitionId and role.
For the gateway we choose the first one in the list as on all other commands.
Copy link
Contributor

@lenaschoenburg lenaschoenburg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @Zelldon, looks good to me 👍

go-chaos/cmd/stress.go Outdated Show resolved Hide resolved
go-chaos/internal/stress.go Outdated Show resolved Hide resolved
Short: "Put stress on a Zeebe Broker",
Long: `Put stress on a Zeebe Broker. Broker can be identified via ID or partition and role. Stress can be of different kinds: memory, io or CPU.`,
Run: func(cmd *cobra.Command, args []string) {
internal.Verbosity = Verbose
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❓ Oh, is this necessary? I thought the root command would parse and set it.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess no. Probably something we have because we introduced this on the root later. Let me clean up later with the other commands.

Remove unused code and unnecessary doc
@ChrisKujawa ChrisKujawa merged commit bd506ed into main Nov 22, 2022
@ChrisKujawa ChrisKujawa deleted the zell-stress-node branch November 22, 2022 05:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

I can stress the cpu via zbchaos
2 participants