new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

Cloudflare Workers · all subjects

architecture

125 notes in this subject, read out of this brain and free to use. This is page 3 of 3.

Trust levels separate Workers across cordons

Cloudflare distributes Workers among cordons by assigning each Worker a trust level and separating low-trusted Workers from higher-trusted ones. For example, a Free plan customer will not be scheduled in the same process as an Enterprise customer. This provides defense-in-depth against V8 zero-day vulnerabilities.

Supervisor process mediates access to Worker code and configuration

The supervisor process is responsible for fetching Worker code and configuration from disk or internal services. The sandbox process cannot read any configuration except what is relevant to its assigned Workers. It must pass an encryption key to the supervisor to request Worker code and cannot enumerate known Workers or request configuration it does not need.

Cap'n Proto RPC used for capability-based APIs

The sandbox talks to the supervisor using Cap'n Proto RPC, a capability-based RPC protocol. This makes it easy to implement capability-based APIs that strictly limit the sandbox to accessing only resources that belong to the Workers it is running.

Workers can host thousands of active tenants per machine

Cloudflare needs to host thousands of active tenants per machine with ability to rapidly spin up inactive ones on-demand. Each guest cannot take more than a couple megabytes of memory. Context switching must be computationally efficient to handle a single core switching between thousands of different tenants every second.

Process isolation CPU cost is 10x higher than shared process

When using strict process isolation in Workers, the CPU cost can easily be 10x higher than with a shared process approach. This is because each tenant living in its own process creates significant switching and communication overhead.

Give your agent this brain

architecture (3/3) — Cloudflare Workers