Skip to main content

Stress Testing Overview

ML Defender has been validated with 36,000 events across progressive stress tests, demonstrating production-grade stability and graceful degradation under extreme load.

Events Processed

36,000 total events

Peak Throughput

364.9 events/second

Errors

0 crypto/decompression errors

Test Design

Progressive Load Tests (Day 52)

From source/README.md:179-203: ML Defender underwent 4 progressive stress tests on Day 52: Total Results (36K events):

Key Discoveries

Production-Ready Components:
  • ✅ Crypto pipeline: 0 errors at 36K events
  • ✅ CPU efficiency: 54% max under extreme load
  • ✅ Memory stable: 127 MB RSS
  • ✅ Graceful degradation: No crashes when capacity exceeded
Capacity Planning Insights:
  • IPSet capacity finite (max realistic: 500K IPs)
  • After ~1000 IPs, insertions fail (expected behavior)
  • System exhibits backpressure without crashes

8-Hour Stability Test

Test Configuration

From source/stress_test_8h.sh:

Test Phases

From source/stress_test_8h.sh:575-613 (traffic_generator_full.sh):
1

Phase 1: Warm-up (30 min)

  • Low load, gradual increase
  • HTTP/HTTPS requests (5/interval)
  • DNS queries (10/interval)
  • ICMP ping (3/interval)
2

Phase 2: Normal Load (2 hours)

  • Mixed protocols
  • HTTP/HTTPS: 10 requests/interval
  • DNS queries: 15/interval
  • Ping traffic: 5/interval
  • Simulates typical network behavior
3

Phase 3: Stress Testing (1.5 hours)

  • High sustained load (3-min cycles)
  • HTTP/HTTPS: 20 requests/interval
  • DNS: 30/interval
  • Stress bursts: 50 concurrent requests/minute
  • High-entropy traffic: 10/interval
4

Phase 4: Ransomware Simulation (1 hour)

  • Fake C2 connections: 10/interval
  • SMB lateral movement: 15/interval
  • Encrypted payloads: 20/interval
  • Tests detection accuracy under attack
5

Phase 5: Sustained Load (3 hours)

  • Continuous moderate traffic
  • HTTP/HTTPS: 12/interval
  • DNS: 20/interval
  • Tests long-term stability
6

Phase 6: Cool Down (30 min)

  • Gradual traffic reduction
  • Verify clean shutdown

Running Stress Tests

Quick Stress Test (10 min)

Full 8-Hour Test


Load Profiles

Hospital Benchmark

From source/scripts/day11_hospital_benchmark/: ML Defender includes realistic hospital traffic profiles:
Electronic Health Records
Simulates typical EHR system traffic.
Characteristics:
  • HTTP/HTTPS requests to EHR API
  • Database queries (simulated)
  • Average: 50 requests/sec
  • Peak: 120 requests/sec

Custom Traffic Mix

From source/stress_test_8h.sh:616-629:

Metrics Collection

Monitoring Script

From source/stress_test_monitor.sh:

Collected Metrics

  • CPU usage per component (%)
  • Memory usage (RSS MB)
  • Network throughput (packets/sec, bytes/sec)
  • Disk I/O (reads/writes)
  • Context switches
  • Events processed (total count)
  • Processing rate (events/sec)
  • Queue depth (current backlog)
  • Error counts (crypto, decompression, parse)
  • Latency (p50, p95, p99)
  • IPSet insertions (successes/failures)
  • IPs blocked (total count)
  • Iptables rule evaluations
  • Batch processing stats

Performance Benchmarking

17-Hour Sniffer Stability Test

From source/TESTING.md:164-182:

Component Latency Breakdown

From source/TESTING.md:282-296: End-to-end latency: ~64 μs (normal path)

Capacity Planning

Resource Recommendations

Based on 36K event stress testing and 17-hour stability validation:
Small Deployment (Home/SMB):
  • CPU: 2 cores @ 2.5 GHz
  • RAM: 4 GB
  • Network: 100 Mbps
  • Capacity: 50-100 events/sec
Medium Deployment (Enterprise):
  • CPU: 4 cores @ 3.0 GHz
  • RAM: 8 GB
  • Network: 1 Gbps
  • Capacity: 200-500 events/sec
Large Deployment (Hospital/ISP):
  • CPU: 8 cores @ 3.5 GHz
  • RAM: 16 GB
  • Network: 10 Gbps
  • Capacity: 1000+ events/sec

IPSet Capacity Planning

From source/README.md:196-203:

Stress Test Analysis

Automated Report Generation

From source/stress_test_8h.sh:138-200:

Next Steps

Testing Guide

Run unit and integration tests

Performance Tuning

Optimize system performance

Monitoring

Set up production monitoring

Troubleshooting

Debug performance issues