PropertyDamage.Nemesis.CPUStress (PropertyDamage v0.2.0)

View Source

Create CPU stress in the BEAM VM.

Spawns processes that consume CPU cycles, useful for testing behavior under high load, scheduler contention, and timeout handling.

Configuration

  • :intensity - Load level from 1-10 (default: 5)
  • :schedulers - Number of schedulers to stress (default: all)
  • :duration_ms - How long to stress (default: 5000ms)

Warning

This operation spawns busy-loop processes. It will affect system responsiveness during the stress period.

Example

def commands do
  [
    {HandleRequest, weight: 5},
    {PropertyDamage.Nemesis.CPUStress, weight: 1}
  ]
end

Testing Behavior

Under CPU stress, your system should:

  • Maintain responsiveness (or gracefully degrade)
  • Handle timeouts appropriately
  • Not lose data during high load