Skip to content

Concurrent Parallel Rules Benchmark ​

This benchmark measures the maximum number of concurrent SQL rules that an engine can execute on a single stream in parallel before memory accumulates or drain latency increases.

The benchmark compares rekuiper 0.505 with LF Edge eKuiper 2.4.1 under identical container limits.


1. Test Configuration ​

Both engines run with identical container limits in Docker:

ParameterValueDescription
CPU Limit1.0 coreOne pinned physical CPU core (--cpuset-cpus=2 --cpus=1)
Memory Limit1 GiBBounded memory with swap disabled (--memory=1g --memory-swap=1g)
Worker Threads1 threadTOKIO_WORKER_THREADS=1 (rekuiper), GOMAXPROCS=1 (eKuiper)
Memory Target900 MiBGOMEMLIMIT=900MiB (eKuiper Go runtime limit)
Stream IngestionhttppushIn-process HTTP push broadcast to active rules
Sampling Interval1.0 secondLinux cgroup v2 metrics (cpu.stat, memory.stat, memory.current)

Workload SQL Rule ​

Each rule evaluates the following SQL statement:

sql
SELECT id, device, temp FROM rawdata WHERE temp > 21.0;

Each rule sends matched records to a nop sink. The nop sink discards records without I/O operations.

Load Profile ​

  • Input Ingestion Rate: Constant 500 events per second over a 30.0-second window.
  • Rule Evaluation Rate: $500 \times N$ rule evaluations per second.

2. Sustainability Criteria ​

A test tier is sustainable when the engine processes events at arrival rate without buffer backlog:

  1. Stable Memory Plateau:

    • The test records anonymous heap memory (anon in memory.stat).
    • Memory during the second half of the run (seconds 15 to 30) must establish a flat plateau ($\Delta M \le 2.0\text{ MiB}$).
    • Memory must not climb steadily toward the container ceiling.
  2. Zero Drain Latency:

    • When the load generator stops at 30.0 seconds, processing must finish immediately ($\text{Drain Lag} \le 1.0\text{s}$).

A test tier is unsustainable when:

  1. Queue Buffer Accumulation: The CPU saturates at 100% capacity and falls behind message arrival. Channel queues store unconsumed records, and heap memory increases continuously.
  2. Drain Lag: Processing continues past the 30.0-second window because accumulated records drain slowly from internal queues.

3. Benchmark Results ​

Table 1: Head-to-Head Comparison (Equal Baseline) ​

This table compares both engines at 50, 100, and 200 parallel rules:

Parallel RulesIngest RateRule Evaluation RateEngineCPU Load (Mean)Peak Memory (Anon)Memory per RuleDrain LagSustainability Status
50500 msg/s25,000 /srekuiper 0.50513.2%7.6 MiB38 KiB0.0sSustained (Level)
50500 msg/s25,000 /seKuiper 2.4.148.7%33.0 MiB277 KiB0.0sSustained (Level)
100500 msg/s50,000 /srekuiper 0.50522.8%10.1 MiB40 KiB0.0sSustained (Level)
100500 msg/s50,000 /seKuiper 2.4.180.3%66.4 MiB254 KiB+0.2sSustained Ceiling
200500 msg/s100,000 /srekuiper 0.50543.3%15.2 MiB37 KiB0.0sSustained (Level)
200500 msg/s100,000 /seKuiper 2.4.195.3%613.6 MiB2,940 KiB+28.1sFailed (Queue Backlog)

Table 2: Concurrency Summary (Ceiling Comparison) ​

Performance Metricrekuiper 0.505eKuiper 2.4.1Ratio / Difference
Maximum Sustainable Rules1,000 rules100 rules10.0x higher concurrency
Sustained Rule Evaluations500,000 evals/s50,000 evals/s10.0x higher throughput
Idle Memory per Active Rule~40 KiB / rule~254 KiB / rule6.3x lower memory footprint
CPU Utilization at 100 Rules22.8% of 1 core80.3% of 1 core3.5x lower CPU utilization
Processing at 200 RulesSustainable (0.0s lag)Failed (+28.1s lag)eKuiper accumulates queue backlog
Peak Memory StabilityLevel ($\Delta M = -1.1\text{ MiB}$)Accumulated (+201.9 MiB)rekuiper maintains flat plateau

Table 3: rekuiper Concurrency Scaling Ladder ​

This ladder records rekuiper performance as active rules increase from 50 to 2,000:

Active RulesInput RateRule Evals / sCPU Load (Mean)Peak Heap (Anon)Trajectory $\Delta M_{15-30s}$Drain LagTest Status
50500 msg/s25,000 /s13.2%7.6 MiB+0.4 MiB (+5.6%)0.0sLevel (Sustainable)
100500 msg/s50,000 /s22.8%10.1 MiB-0.1 MiB (-1.0%)0.0sLevel (Sustainable)
200500 msg/s100,000 /s43.3%15.2 MiB-0.2 MiB (-1.3%)0.0sLevel (Sustainable)
300500 msg/s150,000 /s58.8%20.5 MiB+0.1 MiB (+0.5%)0.0sLevel (Sustainable)
500500 msg/s250,000 /s87.0%70.6 MiB-0.5 MiB (-0.7%)0.0sLevel (Sustainable)
750500 msg/s375,000 /s88.3%184.5 MiB+1.2 MiB (+0.7%)0.0sLevel (Sustainable)
1,000500 msg/s500,000 /s90.1%251.4 MiB-1.1 MiB (-0.4%)0.0sCertified Peak Ceiling
1,500500 msg/s750,000 /s90.2%379.4 MiB+18.4 MiB (+5.1%)+9.8sQueue Lag (Unsustainable)
2,000500 msg/s1,000,000 /s95.4%203.9 MiB+42.1 MiB (+26.0%)+75.0sQueue Lag (Unsustainable)

4. Key Findings ​

10x Higher Rule Concurrency ​

  • rekuiper sustains 1,000 parallel rules on one CPU core. It evaluates 500,000 rule queries per second with zero drain delay and stable memory.
  • eKuiper 2.4.1 reaches its sustainability ceiling at 100 rules. At 200 rules, eKuiper CPU saturates at 95.3%, memory increases from 250 MiB to 613 MiB, and drain latency increases by +28.1 seconds.

Memory Footprint per Active Rule ​

  • rekuiper allocates approximately 40 KiB of baseline memory per active rule.
  • eKuiper allocates approximately 254 KiB of baseline memory per active rule (6.3x larger).

Execution Efficiency ​

  • At 100 rules (50,000 rule evaluations/second), rekuiper consumes only 22.8% of one core.
  • eKuiper consumes 80.3% of one core for the same workload (3.5x higher CPU load).

5. How to Reproduce ​

Run the automated test script in the repository:

bash
# Run the benchmark ladder
python3 test/benchmark/multiple_rules/run_benchmark.py

Raw telemetry logs are in test/benchmark/multiple_rules/.

Released under the Apache-2.0 / MIT License.