Docs

Scheduler Configuration

CROWDio ships with multiple scheduling algorithms. This page covers how to list, inspect, switch the active scheduler at runtime, and understand the mechanism behind each algorithm.


Pluggable Scheduler Architecture

CROWDio employs a strategy-based scheduling design — scheduling algorithms are plugged in without modifying core system logic.

graph LR
    JM["Job Manager"] --> SF["Scheduler Factory"]
    SF -->|"Strategy=FIFO"| FIFO["FIFOScheduler"]
    SF -->|"Strategy=WRR"| WRR["WRRScheduler"]
    SF -->|"Strategy=EDAS"| EDAS["EDASScheduler"]
    SF -->|"Strategy=ARAS"| ARAS["ARASScheduler"]
    SF -->|"Strategy=MABAC"| MABAC["MABACScheduler"]
    FIFO --> TD["Task Dispatcher"]
    WRR --> TD
    EDAS --> TD
    ARAS --> TD
    MABAC --> TD

Scheduling Data Flow

  1. Metric Ingestion via HEARTBEAT — Each worker transmits a periodic heartbeat containing CPU load, battery level, available RAM, and network latency. The Foreman parses these and updates the central database — ensuring the scheduler always has the latest cluster snapshot.
  2. Scheduler Instantiation — When a client submits a job, a Scheduler Factory instantiates the configured algorithm.
  3. Decision Engine — The scheduler retrieves the latest device metrics and runs its selection logic.
  4. Task Dispatch — The task is assigned to the selected device — either next in queue (FIFO) or the device with the highest suitability score (MCDM).

Available Schedulers

ID Name Strategy
fifo First-In First-Out Tasks dispatched in submission order — no device state evaluation
round_robin Round Robin Cycles evenly across available workers
least_loaded Least Loaded Selects worker with fewest active tasks
performance Performance-Based Prefers workers with historically faster completion times
priority Priority Respects job/task priority score
wrr Weighted Round Robin (MCDM) Assigns suitability scores via weighted MCDM criteria
edas EDAS (MCDM) Evaluation Based on Distance from Average Solution
aras ARAS (MCDM) Additive Ratio Assessment
mabac MABAC (MCDM) Multi-Attributive Border Approximation Area Comparison

Algorithm Details

FIFO — First In First Out (Baseline)

Tasks dispatched to workers strictly in arrival order. No evaluation of device state, battery, or CPU.

!!! warning “Head-of-Line Blocking” FIFO can cause a high-performance device to sit idle while a slow device processes the front-of-queue task. This “blind” assignment leads to sub-optimal cluster throughput — especially on heterogeneous mobile clusters.


Weighted Round Robin (WRR)

Enhances Round Robin by assigning a static weight to each device based on hardware capabilities. Devices with higher weights receive proportionally more tasks.

Example: Device A (weight=3) receives 3 tasks for every 1 task assigned to Device B (weight=1).

Provides a basic layer of load balancing by acknowledging hardware heterogeneity.


EDAS — Evaluation Based on Distance from Average Solution

EDAS evaluates alternatives based on distance from the average solution (not the ideal solution), making it robust and computationally lightweight.

Mechanism:

  1. Calculate the average value for each criterion across the cluster (e.g., average battery level).
  2. Compute two distances per device:
    • PDA (Positive Distance from Average): magnitude by which the device outperforms the average.
    • NDA (Negative Distance from Average): magnitude by which the device underperforms.
  3. Select the device with the highest PDA and lowest NDA.

Due to low computational complexity, EDAS is well-suited for high-throughput scheduling scenarios.


ARAS — Additive Ratio Assessment

ARAS operates on the principle that utility is directly proportional to the relative effect of criterion values and weights.

Mechanism:

  1. Define a theoretical optimal alternative — a hypothetical device with the best values for all metrics currently observed.
  2. Sum weighted normalized performance values for each device.
  3. Compute a utility degree — the ratio of each device’s score to the optimal score.
  4. Select the device with the highest utility degree.

Computationally efficient and highly sensitive to small real-time changes in device state.


MABAC — Multi-Attributive Border Approximation Area Comparison

A geometric MCDM method that classifies devices into strictly defined approximation areas.

Mechanism:

  1. Compute a Border Approximation Area (BAA) for each criterion using the geometric mean of all device metrics.
  2. Classify each device:
    • Upper Approximation Area (G+): device metrics exceed the border → Ideal.
    • Lower Approximation Area (G−): device metrics fall below the border → Anti-Ideal.
  3. Select the device with the greatest positive distance into the Upper Approximation Area.

Provides stable rankings even when device metrics are highly volatile — particularly suited for fluctuating mobile networks.


MCDM Criteria and Weighting

MCDM schedulers evaluate workers using a weighted multi-criteria decision matrix. Criterion weights are configurable.

Criterion Type Description
Available RAM Benefit Free memory on worker
CPU availability Benefit Percentage of CPU not in use
Network bandwidth / latency Benefit/Cost Connection quality to Foreman
Battery level Benefit Remaining battery (Android workers)
Current CPU load Cost Active processing load
Task throughput Benefit Tasks completed per unit time
Failure rate Cost Proportion of failed tasks historically
Energy consumption Cost Estimated energy cost per task

Entropy-Based Weighting: Criterion weights are dynamically assigned using the Shannon Entropy Method. Criteria exhibiting greater variability across the cluster receive higher weight — ensuring the scheduler responds to the most discriminative factors in real time.


API Commands

List Available Schedulers

curl http://localhost:8000/api/scheduler/algorithms

Get Active Config

curl http://localhost:8000/api/scheduler/config

Switch Scheduler

curl -X POST http://localhost:8000/api/scheduler/activate/fifo
curl -X POST http://localhost:8000/api/scheduler/activate/wrr
curl -X POST http://localhost:8000/api/scheduler/activate/edas
curl -X POST http://localhost:8000/api/scheduler/activate/aras
curl -X POST http://localhost:8000/api/scheduler/activate/mabac

Update MCDM Weights

curl -X PUT http://localhost:8000/api/scheduler/config \
  -H "Content-Type: application/json" \
  -d '{
    "algorithm": "aras",
    "weights": {
      "cpu": 0.3,
      "memory": 0.2,
      "throughput": 0.3,
      "failure_rate": 0.1,
      "latency": 0.1
    }
  }'

Scheduling Info

curl http://localhost:8000/api/scheduling-info

Returns: active algorithm, per-worker criteria scores for the last decision, pending task queue depth.


Experimental Results

See the full scheduler evaluation results, including FIFO vs. WRR comparison across 1M, 10M, and 100M Monte Carlo trials.

Summary finding: WRR achieved a 56% latency reduction over FIFO at 100M trials on a 6-device heterogeneous cluster.


When to Use Each Scheduler

Scenario Recommended
Simple prototyping / stable homogeneous workers fifo or round_robin
Mixed PC + Android workers wrr, edas, or aras
Battery-critical Android workers MCDM with high battery weight
Long-running jobs with retry logic performance (rewards reliable workers)
Strict job priority ordering priority
Highly volatile mobile network mabac (stable rankings under volatility)