CPU-intensive workloads for performance evaluation using Sysbench.
CPU microbenchmarks test processor performance using:
- Sysbench CPU: Prime number computation benchmark
docker build -t sysbench_micro .# Run sysbench CPU test with prime number calculation
docker run -itd --name="worker" --runtime=runc --cpuset-cpus=0 --memory=512m sysbench_micro
# Execute the benchmark inside the container
docker exec -itd worker /app/run_sysbench.sh 1 20000 1 300
# Copy results
docker exec worker cat /app/cpu.log > cpu_results.log- threads: Number of CPU threads (e.g., 1)
- primes: Maximum prime number for calculation (e.g., 20000)
- duration: Test duration in seconds (e.g., 300)
- runtime: Container runtime (runc, runsc-kvm)
- container_mem: Memory limit per container (e.g., 512m)
run_sysbench.sh <threads> <primes> [output_file] <duration>- Run sysbench CPU tests