Sub topic 1
Why We Isolate Workloads
Prerequisites
This chapter assumes you can use a Linux or macOS command line. You should know what a process is and what an operating system kernel does. You should also be comfortable with files, directories, and permissions.
The problem: many programs, one machine
A server rarely runs just one program. A single host might run a web application, a database, a job queue, and a monitoring agent. If all of them share the same operating system with no boundaries, they interfere with each other in predictable ways.
Isolation means placing limits around a workload. A workload is a program, or a group of programs, that does a job. The limits control what the workload can see, what it can use, and what it can damage.
Four things that go wrong without isolation
| Problem | Example |
|---|---|
| Dependency conflicts | App A needs Python 3.8 libraries. App B needs Python 3.12 libraries. Both cannot own the same system path. |
| Resource contention | A memory leak in one program uses all RAM. The kernel then kills or slows unrelated programs. |
| Fault spread | A crash, or a runaway process that fills the disk, takes down every neighbor. |
| Security exposure | If an attacker compromises one program, they can read files and processes that belong to the others. |
The first two are about reliability. The last two are about blast radius, which is the amount of damage one failure or compromise can cause. Good isolation keeps the blast radius small.
Three questions every isolation method answers
Any isolation technique has to settle three questions. You can use them to judge every approach in this tutorial.
- Visibility: what can the workload see? Can it list other processes, read other files, or reach other network ports?
- Resources: how much CPU, memory, and disk I/O can it use?
- Privilege: what can it do to the host if it is malicious or buggy?
Different technologies answer these with different strength and cost. Stronger isolation usually costs more memory, startup time, or management effort.
A spectrum of approaches
Isolation is not a single feature. It is a range of options, ordered here from weakest to strongest.
- Separate users and permissions. Each program runs as its own user. This is cheap, but the programs still share the same filesystem layout, process list, and installed libraries.
- Containers. The kernel gives each workload its own view of processes, files, and network, and caps its resources. Containers share the host kernel.
- Virtual machines. Each workload runs a full guest operating system on virtualized hardware. Each guest has its own kernel.
- Separate physical machines. This gives the strongest boundary and the highest cost.
The rest of this tutorial focuses on the middle two. They solve the same problem in different places. Containers draw the boundary inside one kernel. Virtual machines draw it at the hardware level.
Where the cost shows up
Isolation is a trade. A workload that is cheap to start and light on memory tends to share more with its neighbors. A workload that shares almost nothing tends to need its own kernel, its own memory reservation, and a longer boot.
The following chapters compare these costs one by one. You will see how a virtual machine builds its boundary, how a container builds a different one, and how to pick between them.
Exercise
A team runs a reporting job and a customer-facing API on one host. The reporting job occasionally uses all available memory, and the API becomes slow. Which of the three isolation questions (visibility, resources, privilege) is the main concern, and what does that tell you about the kind of limit needed?
Show answer
The main concern is resources. The reporting job needs a hard cap on memory so it cannot starve the API. The team needs an isolation method that limits resource use per workload, not only one that hides files or processes from each other.