Log inStart free
LESSON 24.08 · 5 STAGES · 3 CONTROLS · 3 CHECKSPRO · PREVIEW

Resource quotas and cleanup

Watch quotas stop runaway commands, then see what each cleanup leaves behind.


Pro lesson. Stage 1 is free to watch. Pro opens all 5 stages, 3 controls and 3 checks, in this lesson and every other.

Go Pro · $8.25/mo
EXPLAINER · 24.08 · SANDBOX BAYQUOTA 2 CORES · 512 MB · 8 EPISODES FIT
01
Stage 1 of 5 · Set the quotas
A cgroup holds the episode's processes, and each quota caps one resource. 8 episodes fit on one worker.
Explain it simply

The dashed box is one episode's sandbox. A cgroup, a group of processes the kernel limits together, holds every process the agent starts. Each ochre mark is a quota, a hard cap on one resource. With these quotas, 8 episodes share the worker's 16 cores, the grid of cells.

The sandbox quotas are 2 cores, 512 MB memory, 1,024 MB disk and 64 processes. It also has 180 s and 4,000 tokens. 8 episodes fit on the 16-core worker.

use, writingquotaover quota, failed, left behindresult, cleanthis episode's cgroup
sandbox cgroup · one episodecgroup quotasepisode quotasCPU2 coresmemory512 MBdisk1,024 MBprocesses64runtime180 stokens4,000worker · 16 corese1e2e3e4e5e6e7e88 episodes fitone episode's sandboxsandbox cgroup · one episodecgroup quotasepisode quotasCPU2 coresmemory512 MBdisk1,024 MBprocesses64runtime180 stokens4,000worker · 16 corese1e2e3e4e5e6e7e88 episodes fitone episode's sandbox
Toy: one episode on a 16-core worker, ticks of 1/40 s
STAGE 1 / 5
MATH · STAGE 1HOVER A SYMBOL OR A SHAPE
n=min⁡r⌊Hrqr⌋\sy{n}{out}{n} = \min_r \left\lfloor \frac{\sy{H}{param}{H_r}}{\sy{q}{param}{q_r}} \right\rfloor
n=min⁡(162,8192512,655361024,102464)=8n = \min(\tfrac{16}{2}, \tfrac{8192}{512}, \tfrac{65536}{1024}, \tfrac{1024}{64}) = 8

The episodes per worker is the smallest worker-to-quota ratio.

Common mix-ups

MYTHKilling the agent's process stops all its work.

The fix, and 1 more mix-up with the diagram to show them, come with Pro.

Predict, then reveal
3 CHECKS · PRO
Q01With loose quotas, does the log flood still fail at the disk quota?

Make your guess, then test it in the diagram. All 3 checks come with Pro.

PRO LESSON · YOU WATCHED STAGE 1 OF 5
Unlock the full explainer
  • 4 more stages and 3 live controls
  • 2 mix-up cards and 3 predict-then-reveal checks
  • Watch it as a narrated video, in three voices
  • Every Pro lesson and capstone · 656 in total

$99 a year, or $15 a month. Cancel any time.