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

I can stress the cpu via zbchaos #238

Closed
Tracked by #139
ChrisKujawa opened this issue Nov 17, 2022 · 0 comments · Fixed by #242
Closed
Tracked by #139

I can stress the cpu via zbchaos #238

ChrisKujawa opened this issue Nov 17, 2022 · 0 comments · Fixed by #242
Assignees

Comments

@ChrisKujawa
Copy link
Member

I should be able to stress the CPU of a broker or gateway via zbchaos.

This allows us to support experiments like: stress-cpu-on-broker and other

@ChrisKujawa ChrisKujawa self-assigned this Nov 17, 2022
ChrisKujawa added a commit that referenced this issue Nov 22, 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:**
```sh
$ ./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:**

```sh
$ ./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
```
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 a pull request may close this issue.

1 participant