chaotic icon indicating copy to clipboard operation
chaotic copied to clipboard

Stress On workload machine in nomad

Open thatsk opened this issue 2 years ago • 3 comments

It would be nice if we generate a load on the client. This is a starting point but I think if we can generate load and nomad clients get high utilized then it should allocate allocation on another workload

thatsk avatar Jan 19 '23 15:01 thatsk

see comment https://github.com/ngine-io/chaotic/issues/19#issuecomment-1398081030

resmo avatar Jan 20 '23 08:01 resmo

job "pumba" {
  datacenters = ["dc1"]
  type = "sysbatch"
  parameterized {
    meta_required = ["container_name"]
    meta_optional = ["cpu","memory","stress_time","timeout"]
  }

  group "pumba" {
    task "pumba" {
      driver = "docker"
      config {
        args = [
          "--random",
          "--log-level=info",
          "stress",
          "-d",
          "${NOMAD_META_stress_time}",
          "-stressors=--cpu ${NOMAD_META_cpu} --io 2 --vm 1 --vm-bytes ${NOMAD_META_memory} --timeout ${NOMAD_META_timeout}",
          "re2:^${NOMAD_META_container_name}"
         ]
        image = "gaiaadm/pumba:latest"
        network_mode = "bridge"
        volumes = [
            # Use absolute paths to mount arbitrary paths on the host
            "/var/run/docker.sock:/var/run/docker.sock"
        ]
      }
      resources {
        cpu    = 400
        memory = 512
      }
    }
  }
}

thatsk avatar Jan 20 '23 17:01 thatsk

this is like I created a job for stress load on the container which is deployed on nodes. Let me know your thoughts

thatsk avatar Jan 20 '23 17:01 thatsk