genload - Linux


Overview

genload is a powerful Linux command used to generate synthetic load on a system for performance evaluation, capacity planning, and stress testing. It creates customizable load patterns to simulate realistic usage scenarios and identify performance bottlenecks.

Syntax

genload [options] <load-type> <arguments>

Options/Flags

  • -t, –type: Specify the load type (CPU, memory, disk, network).
  • -n, –num-processes: Number of processes to generate (default: 1).
  • -d, –duration: Duration of the load in seconds (default: 60).
  • -p, –priority: Priority of the generated load (default: 0).
  • -r, –random: Use random load patterns instead of sequential.
  • –delay: Introduce a delay between load operations in milliseconds.
  • –cpu-util: Target CPU utilization percentage (CPU load only).
  • –mem-util: Target memory utilization percentage (memory load only).
  • –disk-iops: Number of disk input/output operations per second (disk load only).
  • –network-bandwidth: Network bandwidth utilization in megabits per second (network load only).
  • –help: Display usage information and exit.

Examples

Generate CPU load with 4 processes for 120 seconds:

genload --type cpu --num-processes 4 --duration 120

Generate random memory load with 1 process for 60 seconds:

genload --type memory --num-processes 1 --duration 60 --random

Generate network load with 50Mbps bandwidth for 10 minutes:

genload --type network --network-bandwidth 50 --duration 600

Common Issues

  • Insufficient system resources may limit the generated load.
  • Incorrect load parameters can lead to unrealistic or inconsistent results.
  • Long-duration load tests may require monitoring to prevent system overloads.

Integration

genload can be combined with other commands for advanced scenarios:

  • Use dstat to monitor system metrics during load generation.
  • Integrate with systemd for automated load testing.
  • Create custom load scripts using bash or Python.

Related Commands

  • stress-ng
  • wrk
  • iperf