← Inside orch contents

Chapter 28 - Worked Answers

1. Atlas arithmetic

Two replicas at250m and128Mi contribute500 millicores and268435456 bytes. The service count is one and replica count two. One positive published-port declaration contributes one, not two: addServiceUsage counts declarations separately from per-replica requested CPU/memory. A scale-zero service can still count as a service with positive port declarations. These are declared quantities, not measured process utilization or actual host socket counts.

2. Concurrent acceptance

Starting at two total replicas under maximum three, either single scale-to-two is valid and projects three. Both succeeding would project four. MemoryService holds its mutex across replacement usage, Check and mutation, and the executed fixture observes one success/one denial. The PostgreSQL path separately takes a namespace transaction advisory lock before usage/check and must retain it through mutation. That SQL mechanism is inspected here, not the default executable backend or an executed database quota race.

3. Cumulative runtime is sampled twice

The current report sums both snapshots and returns180 runtime seconds. Each snapshot contains lifetime-to-date for retained tasks, so the second includes the first minute again. The total is not120 unique elapsed/billable seconds. Requested CPU/memory totals are likewise sums of samples rather than integrated core-hours/byte-seconds. A downstream duration model must define interval integration or deltas, retention and missing samples instead of renaming the existing total.

4. Operational interpretation

Export a bounded namespace/time range, retain RFC3339 timestamps and state each column’s unit. Use requested quantities for declared-footprint analysis, claim count for logical inventory and cumulative task duration only with a documented non-double-counting transformation. Do not infer resident memory, CPU time, stored bytes, pricing or invoices. Default memory snapshot lifetime and retention also limit history. Commercial accounting requires additional collection, durable records and independently validated definitions.

These answers use chapter 28 and its scoped claim/execution records. Design changes remain proposals until separately implemented and tested.