Springboot chaos-monkey assaults [killApplicationActive and memoryActive] not working

1.6k Views Asked by At

I am using Springboot 2.3.1.RELEASE and chaos monkey its working fine for latencyActive and exceptionsActive.

 <dependency>
        <groupId>de.codecentric</groupId>
        <artifactId>chaos-monkey-spring-boot</artifactId>
        <version>2.2.0</version>
    </dependency>

Following two assaults not working

Kill application

     chaos.monkey.assaults.killApplicationActive=true
     chaos.monkey.assaults.level=3

Memory

    chaos.monkey.assaults.memoryActive=true
    chaos.monkey.assaults.memoryMillisecondsHoldFilledMemory=90000
    chaos.monkey.assaults.memoryMillisecondsWaitNextIncrease=1000
    chaos.monkey.assaults.memoryFillIncrementFraction=90.15
    chaos.monkey.assaults.memoryFillTargetFraction=90.25
4

There are 4 best solutions below

0
goku On BEST ANSWER

To Kill an application manually follow the below step:

1) Create the assault by:

POST: https://{{server-address}}/{{app-name}}/actuator/chaosmonkey/assaults

{
    "level": 1,
    "deterministic": false,
    "latencyActive": false,
    "exceptionsActive": false,
    "killApplicationActive": true,
    "memoryActive": false,
    "cpuActive": false }

2) Run the created assault by:

POST: https://{{server-address}}/{{app-name}}/actuator/chaosmonkey/assaults/runtime/attack

0
Sourabh Parime On

App kill and memory kill attacks need the attribute runtimeAssaultCronExpression set to a valid cron expression like " * * * * * * ". By default it is set to "OFF"

See documentation: https://codecentric.github.io/chaos-monkey-spring-boot/2.2.0/#_appkiller_assault

0
sakshi goyal On

Use property value for "chaos.monkey.assaults.runtime.scope.assault.cron.expression" as cron expression like */1 * * * * ? or any valid cron expression, to enable chaos monkey runtime assaults on a schedule.

Use property value as OFF otherwise(also default value)

links: https://codecentric.github.io/chaos-monkey-spring-boot/2.1.0/#configuration https://www.programmersought.com/article/11861551911/

0
TWICE On

LatencyActive and ExceptionsActive assaults are low impact assault(Request type), whereas KillApp and Memory are high impact assaults(Runtime assault). So Request type assault can be triggered just by loading them whereas Runtime assault requires an additional step after loading them.

Trigger this Http endpoint and that should execute the assault: /chaosmonkey/assaults/runtime/attack