chaos-mesh icon indicating copy to clipboard operation
chaos-mesh copied to clipboard

Memory stressor is not accepting time field

Open pe55a opened this issue 1 year ago • 3 comments

Bug Report

What version of Chaos Mesh are you using? 2.6.3

What did you do? / Minimal Reproducible Example According to the documentation, the memory stressor should accept time as arguments. I created a YAML file where I have the time field and tried to apply it to k8s.

What did you expect to see? experiment should have been created successfully

What did you see instead? StressChaos in version "v1alpha1" cannot be handled as a StressChaos: strict decoding error: unknown field "spec.stressors.memory.time"

pe55a avatar May 23 '24 14:05 pe55a

Hi @pe55a, that's an issue on the documentation, we should use spec.duration to setup how long the chaos experiment effect.

Could you help us to address the problem on documentation by deleting this field?

Thanks.

STRRL avatar May 28 '24 14:05 STRRL

I'm not sure that time field is supposed to setup how long the chaos experiment execute.

from the doc: time: Specifies the time to reach the memory size. The growth model is a linear model.

So, if I understand this right, time is the time that one can define in order for the chaos to reach the mem size and then keep it at that level till the end of the experiment. This could be useful for testing autoscaling processes when memory increases suddenly or linearly

pe55a avatar May 29 '24 08:05 pe55a

It appears that the documentation is incorrect; however, the functionality is still accessible by passing the --time parameter through the options property. Strangely, this isn't mentioned in the documentation, and the only way to discover it is by examining the CRD itself.

Here’s an example of how to use it:

  stressors:
    memory:
      workers: 1
      size: '1GiB'
      options: ["--time 300s"]

When applied, you'll see the process executed as follows:

memStress --size 1GiB --workers 1 --time 300s --client 1

mertcancam avatar Jan 23 '25 11:01 mertcancam