Edge & Fog Computing · Study deck
Fog Resource Allocation
A gateway is the nearby computer that receives device messages and passes work onward.
Edge Eddie is your guide for this deck.

After studying this chapter
Learning objectives
You will be able to:
- Build a fog resource allocation record from workload contracts and measured capacity.
- Separate hard feasibility gates from ranking and optimization rules.
- Choose between reservations, quotas, priority queues, backpressure, load shedding, and migration.
- Explain why resource allocation must include CPU, memory, accelerator, storage, network, energy, thermal, and failure-mode constraints.
Major section
Start Simple
A gateway is the nearby computer that receives device messages and passes work onward.
- Firmware is the software stored on a device.
- Alarms, camera clips, stock checks, and updates may all reach it at once.
- A high average score can hide a short burst, a hot processor, full memory, or a blocked link.
Major section
Start Simple (continued)
The useful check is whether urgent work still finishes on time while less important work slows down.
- This simple story does not choose exact limits or prove that moving work is safe.
- Those choices need measured demand, spare capacity, and a recovery plan.
- A move can cost more time and energy than it saves.
Major section
Minimum Viable Understanding · Most Valuable Understanding
Allocate to workload contracts, not to device names.: A refrigerator alarm, a video summary, a firmware update, and a status heartbeat should not receive the same treatment.
- Admission control is part of allocation.: Refusing or deferring a task can be the correct answer when accepting it would break existing commitments.
- Queues are signals.: Queue depth, deadline misses, memory pressure, thermal state, and network backlog should change allocation decisions.
- Rebalancing has a cost.: Migrating containers, changing quotas, or moving tasks can interrupt sessions and should be gated by evidence.
- High utilization is useful only after deadlines, safety, recovery, and fairness are protected.
Major section
Why This Chapter Exists
Fog nodes sit close to devices, but they are not miniature clouds with unlimited headroom.
- A gateway may have a small CPU, limited memory, one accelerator, a flash device with finite write endurance, a shared uplink, and a thermal envelope that changes with the enclosure and ambient temperature.
- "Which work gets protected capacity?": Reserve capacity for control, safety, recovery, and observability paths before best-effort work consumes the node.
- "Can this node accept another workload?": Check deadline, memory, network, storage, energy, thermal, and fallback constraints before starting the task.
Major section
The Allocation Surface
Resource allocation is broader than CPU percentages.
- A task can be CPU-light but memory-heavy, network-heavy, flash-write-heavy, accelerator-bound, or thermally risky.
- These feed the Multi-Objective Optimizer, Constraint Solver, and Resource Allocator, which can choose task partitioning, traffic shaping, placement, or caching.
Major section
Build the Allocation Record
The record should be short, measurable, and reviewable.
- Task name, traffic class, deadline, statefulness, persistence need, burst pattern, retry behavior, and criticality.
- Conditions that must be true before a workload starts or receives more quota.
- Priority, fair-share, quota, deadline, or weighted policy used after feasibility gates pass.
Major section
The Stable Allocation Model · Pitfall: A High Score Cannot Override a Hard Gate
A stable allocator is easier to audit when hard gates are separated from ranking.
- React to pressure: throttle best_effort before important work shed optional work before violating critical deadlines migrate only when destination headroom and state cost are acceptable.
- The model can use weighted fairness, deadline scheduling, token buckets, priority queues, or container limits.
- The important part is that the chosen mechanism is tied to the workload contract and verified under pressure.
Major section
Placement, Scheduling, and Admission Gates · Interactive Quiz: Match the Control to the Risk
A fog allocator has three related jobs.
- Placement chooses which node can host a task under CPU, memory, accelerator, storage, network, and energy limits.
- Scheduling orders accepted work using priority, quota, fair share, or earliest-deadline-first rules.
- Admission control decides whether new work may start at all.
Try it: Placement, Scheduling, and Admission Gates · Interactive Quiz: Match the Control to the Risk in the chapter
Major section
Allocation Control Loop
Fog allocation is not a one-time bin-packing exercise.
- The node must observe pressure, adjust work, and document when the allocation record is no longer valid.
- Feasible? Protects hard limits and reserve before 3.
- Admit applies quotas and preserves critical tasks; 4.
- Under pressure, the node may throttle, shed, defer, buffer, or migrate, but Fallback Capacity stays free.
Major section
Allocation Control Loop (continued)
Repeated pressure or deadline drift reaches Review Trigger, reopening the allocation record instead of normalising overload.
- Admit and schedule.: Use reservations, quotas, priorities, or fair-share rules that match workload criticality and measured demand.
- Respond to pressure.: Throttle, shed, defer, buffer, or migrate in an order that preserves critical commitments.
- Reopen the record.: Treat repeated pressure, drift, deadline misses, or failover problems as evidence that the allocation policy needs review.
Major section
Interactive Quiz: Sequence the Allocation Loop · Allocation Pattern Guide
The correct choice depends on measured demand, criticality, and failure mode.
- Control, safety, and local recovery paths should keep capacity even when analytics, updates, or reporting jobs are busy.
- The fog node directly affects equipment, local alarms, or operator safety.
- Average utilization can look healthy while queue age on the critical path is already unsafe.
Try it: Interactive Quiz: Sequence the Allocation Loop · Allocation Pattern Guide in the chapter
Major section
Worked Example: Clinic Cold-Storage Gateway
Normal temperature samples are small and delay tolerant.
- Out-of-range alarms must be processed locally, logged, and shown to staff even when the WAN is down.
- A gateway also runs a daily diagnostic summary and occasionally downloads updates.
- Small periodic events, delay tolerant, can be buffered and replayed when the backhaul returns.
Major section
Worked Example: Clinic Cold-Storage Gateway (continued)
Batch work, useful for maintenance, may be delayed during alarms, WAN outages, or thermal pressure.
- High storage and network demand, must never consume alarm reserve or recovery storage.
- Normal telemetry receives a bounded queue and replay budget.
- Diagnostic summaries run only when queue age and thermal state are healthy.
Major section
Common Mistakes · Review Checklist
Memory, accelerator slots, flash writes, broker queues, uplink backlog, energy, and cooling can be the real limit.
- Backpressure, queue limits, and shedding rules are safer than pretending storage and retry time are infinite.
- Moving a task can duplicate commands, lose local cache, reset TLS sessions, or overload the destination link.
- A node under pressure still needs enough capacity to report health, expose logs, and accept operator actions.
Major section
Reference Notes · Summary
TCP-style feedback, operating-system scheduling, container resource controls, queueing theory, and distributed-systems admission control all inform fog allocation, but none of them replaces local measurement.
- They become engineering evidence only after the node, enclosure, firmware, workload, and network path have been measured.
- Fog resource allocation is a measured capacity decision.
- The strongest designs explain what is allowed to run, what must wait, what can be shed, and what must keep working during degraded modes.
Deck summary
Key takeaways
A gateway is the nearby computer that receives device messages and passes work onward.
- The useful check is whether urgent work still finishes on time while less important work slows down.
- Allocate to workload contracts, not to device names.: A refrigerator alarm, a video summary, a firmware update, and a status heartbeat should not receive the same treatment.
- Fog nodes sit close to devices, but they are not miniature clouds with unlimited headroom.
- Resource allocation is broader than CPU percentages.
Retrieval practice
Recall check 1 of 4

Edge Eddie says: answer from memory, then check your reasoning.
Q1Fog resource allocation should be tied to what, rather than to device names?
Show answer
Answer: B Fog allocation is tied to workload contracts, so critical and best-effort work receive different guarantees regardless of device.
Retrieval practice
Recall check 2 of 4

Edge Eddie says: answer from memory, then check your reasoning.
Q2A fog gateway receives a critical motor-stop command stream and a best-effort video-summary job. CPU is still available on average, but the queue sometimes delays the motor-stop path. What is the strongest allocation decision?
Show answer
Answer: C Fog allocation begins with workload contracts.
Retrieval practice
Recall check 3 of 4

Edge Eddie says: answer from memory, then check your reasoning.
Q3Three tasks needing 2, 2, and 1.5 CPU units arrive at a fog node with 4 CPU units of capacity. What allocation decision protects the system?
Show answer
Answer: C Fog allocation should fit feasible work under hard resource limits and use admission control for work that would overcommit the node.
Retrieval practice
Recall check 4 of 4

Edge Eddie says: answer from memory, then check your reasoning.
Q4Place each resource-allocation control where it lives so you can admit only feasible work and recover cleanly when fog capacity changes.
Show answer
Answer: A Separate demand evidence, scheduling decisions, and recovery review so you can explain why a workload was admitted, placed, or moved.
Q5Complete the admission function so it protects reserved capacity before accepting best-effort work.
Show answer
Answer: A Critical work can use currently free capacity if memory also fits.
Print reference
Answers
Answer key.
- B · Fog allocation is tied to workload contracts, so critical and best-effort work receive different guarantees regardless of device.
- C · Fog allocation begins with workload contracts.
- C · Fog allocation should fit feasible work under hard resource limits and use admission control for work that would overcommit the node.
- A · Separate demand evidence, scheduling decisions, and recovery review so you can explain why a workload was admitted, placed, or moved.
- A · Critical work can use currently free capacity if memory also fits.