--- title: "Fair Scheduler" description: "How Miget dynamically allocates CPU resources across applications." --- The Miget Fair Scheduler keeps your applications responsive by allocating CPU based on real-time demand instead of static quotas. This is a key innovation that enables running multiple applications on a single cloud resource at a fixed price. ## How It Works The Fair Scheduler provides dynamic and fair CPU allocation between multiple applications running on the same shared cloud resource. Its main goals are: - **Maximum Resource Utilization** - When one application is inactive, another can use the unused CPU cycles, increasing overall efficiency - **Starvation Prevention** - No application will be completely deprived of CPU access, even under heavy load from others, ensuring basic responsiveness - **Predictable Performance** - Maintaining stability and performance for all applications despite competition for limited resources ## Example: 0.5 CPU Plan Consider a namespace with a 0.5 CPU plan running two applications. Both apps have access to the full 0.5 CPU - here's how the scheduler handles different scenarios: | Scenario | App A | App B | Result | |----------|-------|-------|--------| | **Only App A needs CPU** | Demands 0.5 | Idle | App A gets full 0.5 CPU | | **Only App B needs CPU** | Idle | Demands 0.5 | App B gets full 0.5 CPU | | **Both need CPU** | Demands 0.5 | Demands 0.5 | Each gets 0.25 CPU (fair split) | | **Burst scenario** | Using 0.5 | Suddenly needs burst | App B gets 0.5 temporarily, then scheduler lowers both to 0.25 | The key insight: applications can burst to use the full CPU allocation when others don't need it, but when demand exceeds supply, the scheduler fairly distributes resources. ## Learn more A visual explainer of how CPU is shared across your apps. Why a fixed plan beats per-service billing for always-on apps.