Skip to content
ethcocoderPublic

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Parasync

para + sync: services that detect when their load is lining up (resonance) and shift their own timing to avoid outages.

Parasync is a small library and control algorithm that prevents synchronized load spikes in distributed systems: cron jobs that all fire at minute zero, retry storms after a partial outage, batch jobs that pile onto the same database at the same time.

The problem

  • Periodic jobs and retries tend to align over time, so peaks add up instead of spreading out.
  • Today's fix is hand-tuned random jitter, which is blind: it does not measure whether peaks are actually aligned and does not guarantee even spreading.
  • Overload events (queue buildup, timeouts, cascading retries) are expensive and hard to debug.

Core idea

Treat every periodic job or retrying client as an oscillator with a phase θ. Measure how synchronized the fleet is with the Kuramoto order parameter R (1 = fully aligned, 0 = evenly spread). A small controller nudges each node's phase away from crowded slots until the load is spread out (a "splay" state), while respecting each job's allowed window.

String theory mapping

String theory Parasync
Resonance: aligned vibrations amplify Aligned load peaks amplify into overload
Compact dimensions set allowed vibrations Geometry = each job's allowed time window / SLA deadline; phases may only move inside it
Duality: two views of one system Time view (queues, latency) and spectrum view (resonance peaks); detect in spectrum, fix in time
Strings split and join Big burst jobs split into phase-shifted shards; shards merge when load is low

What is claimed as new

  1. Resonance detector: a spectral score on aggregate load that flags dangerous alignment before an outage.
  2. Decentralized anti-sync controller: each node adjusts phase using only a shared congestion signal (no central scheduler).
  3. Phase-aware backoff: retry delays use an evenly spread phase instead of pure random jitter.
  4. Window-constrained control: deadlines and SLAs are respected by construction.

Honest status

Prior art exists: random jitter (including "full jitter"), gossip and firefly synchronization, Kubernetes CronJob start deadlines, load shedding. Full jitter is already strong for retry storms, so Parasync must beat it with measurements, not claims. Parasync mainly helps periodic and retry-driven load, not organic user traffic. See EXPERIMENTS.md for the stop conditions.

Documentation map

File Purpose
README.md This overview
ARCHITECTURE.md Components and deployment modes
MATH_SPEC.md Order parameter, controller equations, stability
IMPLEMENTATION_PLAN.md Build order and Python simulation skeleton
EXPERIMENTS.md Benchmarks, baselines, success criteria
ROADMAP.md Phases, risks, product directions

Implemented v0.1 prototype

This repository includes phase and harmonic analysis, spectral load detection, repulsive gossip control, congestion-signal control, hard window constraints, phase-aware retry backoff with jitter baselines, burst splitting, advisor mode, cron/Kubernetes output adapters, and deterministic simulations.

python -m pip install -e .
python -m pytest -q
python -m sim.cron_sim
python -m adapters.cron_advisor --period 60 --offsets 0 0 0 0

The library defaults to advisor behavior and never mutates a scheduler or cluster. Comparative claims against random/full jitter require the planned experiments.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages