Springboot混沌猴子攻击[killApplicationActive和memoryActive]不起作用

igetnqfo  于 2022-11-23  发布在  Spring
关注(0)|答案(4)|浏览(231)

我使用的是Springboot 2.3.1.Release和Chaos Monkey,它在latencyActive和exceptionsActive方面工作正常。

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

连续两次攻击无效

终止应用程序

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

内存

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
oymdgrw7

oymdgrw71#

应用程序删除和内存删除攻击需要将属性runtimeAssaultCronExpression设置为有效的cron表达式,如“******“。默认情况下,将其设置为“OFF”
请参阅文档:https://codecentric.github.io/chaos-monkey-spring-boot/2.2.0/#_appkiller_assault

w9apscun

w9apscun2#

要手动终止应用程序,请执行以下步骤:

1)通过以下方式创建攻击:
开机自检https://{{server-address}}/{{app-name}}/actuator/chaosmonkey/assaults

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

2)通过以下方式运行创建的攻击:
开机自检https://{{server-address}}/{{app-name}}/actuator/chaosmonkey/assaults/runtime/attack

vaj7vani

vaj7vani3#

使用“chaos.monkey.assaults.runtime.scope.assault.cron.expression”的属性值作为cron表达式(如 */1 ****)或任何有效的cron表达式,以启用对计划的chaos monkey运行时攻击。
否则将属性值设为OFF(也是默认值)
链接:https://codecentric.github.io/chaos-monkey-spring-boot/2.1.0/#configuration

e4eetjau

e4eetjau4#

LatencyActive和ExceptionsActive攻击属于低影响攻击(Request类型),而KillApp和Memory攻击属于高影响攻击(Runtime攻击),所以Request类型攻击只需要加载就可以触发,Runtime攻击需要在加载之后再进行一个步骤。
触发此Http端点并执行攻击:/混沌猴子/攻击/运行时/攻击

相关问题