Docs
Napping
An idle workload naps: its requests go to the waker, then its backends stop.
4 min read
A workload naps once no request reached it for its idle window. Each timeline replays one workload, a nap cancelled, then a nap.
AWS
Google Cloud
The steps
- The idle check runs the controller every 5 minutes, on the clock’s 5-minute marks.
- The controller reads each awake workload’s requests over its idle window.
- With none, the controller sends the workload’s requests to the waker, then waits.
- A request during the wait cancels the nap: the route goes back, and nothing stops.
- After the wait, the controller stops the backends, scales them to zero or suspends them.
- A request during the stop wakes the workload once the stop ends.
- Asleep, the router reports the change to the manager, as it reports every change of state.
AWS
- The check reads CloudWatch’s
RequestCountof the target group, in one-minute sums. - The switch sets your rules’ forward weights: 0 to your target group, 1 to the waker’s.
- The wait is the Drain: the rule change reaches every load balancer node.
- A request at the waker during the drain is held, then redirected once the rules are back.
Google Cloud
- The check reads the request counts, or the request logs, 210 s further back: Google publishes them late.
- On a global load balancer, the switch writes a custom error response in each path matcher. The other kinds swap the map’s references.
- The wait lets the change reach the load balancer: 5 minutes for the error response. A swap’s own wait is on Waking.
- After the wait, the controller reads the requests again: one gives the nap up.
Parts and permissions
Each part calls with its own role, which Roles lists.
| Component | AWS | Google Cloud | What it does |
|---|---|---|---|
| The idle check | Runs the controller every 5 minutes. | ||
| The controller | Reads the requests, switches the route, stops the backends. | ||
| Request counts | Read by the controller. | ||
| The route | Sent to the waker for the nap. | ||
| Your backends | Tagged dormeto:workload | Tagged dormeto=managed, as dormetoRouterBackends | Stopped, suspended or scaled to zero. |
| The manager | Takes each change of state (Architecture). |
What can go wrong
- A paused workload never naps, and a pause written during a nap cancels it.
- A nap that fails leaves the workload failed, with its reason: Workloads.
- A schedule’s windows win over the idle rules: Scheduler.
AWS
- A rule that forwards to the target group without Dormeto’s rule is an issue. The workload naps only once it is fixed.
- A router runs at most 10 naps at a time: Workloads.
Google Cloud
- A change of the backends since the onboarding gives the nap up as
backends-changed. - A router has at most 20 naps in flight: Workloads.