Before any code, any cloud, any request, there is a box. You can touch it. It gets warm. It has a plug. This lesson opens that box, in your head, and names every part inside it, because every system you will ever run is still just this box, repeated.
Difficulty: Beginner · Know this first: Nothing. This is the first lesson
The bar below is a worked example for this lesson, not a measurement. It shows shares of 100 for a first afternoon with a machine. The shape is the point: the CPU, the memory, and the disk carry most of the story. Switch the scenario and watch the shares move.
Extra diagram · from scratch to master
Start with the box alone. Add one part at a time until the whole machine is on the map.
Extra diagram · from scratch to master
Follow the wake-up from the button to a ready machine, one step at a time. One step can stop the whole thing.
Pick a machine and see what its numbers mean. Move the sliders and watch the memory, the disk, and the photo count change. The numbers are exact arithmetic, not live measurements. The lesson is the shape: memory is counted in thousands of megabytes, and a disk holds far more than you think.
Memory is sold in gigabytes. 1 GB is 1024 MB, so 16 GB is 16 times 1024 MB.
Disk is sold in gigabytes too. 1024 GB is 1 TB. A photo here is 5 MB, a typical phone photo size.
Try this: (1) Set memory to 8 GB and disk to 1024 GB. Memory is 8192 MB and the disk holds 209,715 photos of 5 MB. (2) Set disk to 256 GB. The disk holds 52,428 photos. Same photo size, smaller cabinet.
Three questions. No score is saved anywhere — this is just you against the material.
I take the same machine four times here. First I name the parts. Then I learn how they talk to each other. Then I size a machine for a job. Last I plan a room full of them.
Definition: A computer has a CPU that does the work, memory that holds what is being worked on, a disk that keeps files when the power is off, a screen that shows, a keyboard and mouse that carry input in, and a network port that connects to other machines. I can point at each one and say its job in one sentence.
Types:
Uses: I use this when I meet a new machine. I name the parts before I touch anything. A new engineer can do the same and stop guessing which part is which.
Dimensions: One machine, one user, a few programs. What breaks first is usually the disk filling up or the memory running out, and I notice it when the machine gets slow for no clear reason. It costs nothing to learn the names. It costs real time when I skip this and guess. The trade is simple: a minute spent naming parts saves an hour of guessing later.
Definition: The parts talk through the CPU. The CPU asks memory for the next instruction. Memory asks the disk for the file. The screen shows the result. The network port brings in messages from other machines. The work moves from the disk to memory, gets done by the CPU, and goes back to the disk.
Types:
Uses: I use this to explain why a machine is slow. If the CPU is idle and the disk light is busy, the machine is waiting on the disk, not working. That changes what I fix.
Dimensions: A few programs at once, a few files open. What breaks is the slowest conversation, usually memory to disk, and I notice it when opening a file takes seconds instead of a blink. It costs attention to watch which part is busy. The trade is that the slowest part sets the speed of the whole machine, so I fix the slowest part first.
Definition: At this level I pick the parts for the work. A machine that edits video needs a fast CPU and a lot of memory. A machine that stores files needs a big disk. A machine that serves a website needs a fast network port and enough memory for many visitors at once.
Types:
Uses: I use this when someone asks me to buy a machine. I ask what the machine will do all day, then I size the parts for that work instead of buying the biggest of everything.
Dimensions: One machine, one job, measured in numbers: how many gigabytes of memory, how many cores, how big a disk. What breaks is the part I sized too small, and I notice it when the job outgrows the machine. It costs money to oversize and time to undersize. The trade is that every part costs money, so I buy the parts the job actually needs.
Memory pressure, seen in numbers. A slow machine is often a machine that ran out of desk space. I check how much memory is free before I blame the CPU. The available number is the one that matters. It is the memory a new program can actually use.
$ free -h
total used free shared buff/cache available
Mem: 7.7Gi 7.3Gi 124Mi 96Mi 671Mi 444Mi
Every flag in the commands above, letter by letter.
free -h: -h means human readable. It prints sizes as 7.7Gi and 444Mi instead of long counts in KiB. I read the available column first. It is the memory a new program can actually use.-h, free prints the same numbers in KiB. The numbers are exact and hard to read at a glance. That is why I type the flag every time.free -m prints the same table in MiB. Scripts and dashboards use plain numbers like that, because they cannot parse 7.7Gi.Check it: run free, then free -h. The first prints 8124896. The second prints 7.7Gi. Same machine, same memory, different reading.
Try it: run free -h on your own machine. If available is under 1 GiB, the machine is swapping to disk, and that is why it feels slow. Close a program and run it again. The number should climb.
A full disk is a slow machine. A disk that is nearly full cannot write fast, and some programs stop working entirely. I check the disk before I buy a faster CPU. A faster CPU does not help when there is nowhere to write.
$ df -h /
Filesystem Size Used Avail Use% Mounted on
overlay 7.5G 70M 7.5G 1% /
Every flag in the commands above, letter by letter.
df -h /: -h means human readable. It prints 7.5G and 70M instead of counts in 1K blocks. The / is the path to check. It means the root disk.df lists every filesystem on the machine. That is a long list. I give it one path when I know which disk I care about.-h, sizes come back as 1K block counts. I cannot tell 7864320 from 7726140 at a glance. The flag turns the numbers into words I can read.df -T adds a Type column. It shows overlay, ext4, or tmpfs, so I know what kind of disk I am looking at.Check it: run df /, then df -h /, then df -T /. Watch the Size column change from a block count to 7.5G, and watch the Type column appear.
Try it: run df -h /. If Use% is above 90, free space first. Delete something big you do not need, then run it again. The number should drop.
Definition: At this level the machine is one of hundreds. I plan the room: power for all of them, cooling to take the heat away, network ports for all of them, and spare machines for the ones that fail. No single machine matters. The room matters.
Types:
Uses: I use this when a service outgrows one machine. I stop asking which machine is fast and start asking how the room survives one machine dying.
Dimensions: Hundreds of machines, thousands of users. What breaks is the shared thing: power, cooling, or the network switch they all plug into, and I notice it when many machines fail together. It costs real planning and real money. The trade is that redundancy costs machines that sit idle, and it buys the right to lose one without losing the service.
One power supply is one failure away from dark. A single machine has a single point of failure in its power. When the power goes, everything on that machine goes with it. I plan for that by knowing what the machine can survive. A laptop has a battery. A server has two power supplies. A desktop has neither, and that is a fact I plan around.
$ uptime
00:12:30 up 17 min, 0 user, load average: 0.91, 0.89, 0.69
$ nproc
4
Every flag in the commands above, letter by letter.
uptime takes no flags here. It prints how long the machine has been up, how many users are logged in, and the load average for the last 1, 5, and 15 minutes.nproc takes no flags here. It prints the number of CPU cores the machine can use. The load average only makes sense next to this number. A load of 0.91 on 4 cores is fine. A load of 9 on 4 cores is not.uptime -p prints one short line, like up 55 minutes. It is the pretty form, for a human reading a status line.nproc --all counts every CPU the system could use, including cores that were taken offline. On this machine both answers are 4. On a machine with cores disabled, they differ.Check it: run uptime, then uptime -p. Then run nproc and nproc --all. The short forms are for scripts. The plain forms are for me.
Try it: run uptime and nproc. The load average is the number of jobs waiting for the CPU. If the load is higher than the core count for a long time, the machine is overloaded. A load of 0.91 on 4 cores is fine. A load of 9 on 4 cores is not.
Heat is a limit you cannot see. A hot CPU slows itself down to survive. The machine looks slow in software and the cause is dust in the fan. I check the load first, then I check the air. If the load is low and the machine is still slow, I look at the fan and the vents.
$ uptime
00:12:30 up 17 min, 0 user, load average: 0.91, 0.89, 0.69
Try it: run uptime three times, a minute apart. If the three load numbers keep climbing while you do nothing, something is running that you did not start. Find it before you blame the hardware.
Memory is fast and small. Disk is slow and big. That gap is the most important fact about a computer. Everything else in this course is, in one way or another, a trick for living with that gap. Caches exist because memory is fast and disk is slow. Databases exist because disk is big and memory is small.
Heat is the hidden limit. A CPU that gets too hot slows itself down to survive. I have seen a machine that looked slow in software and was only dusty inside. The fan could not move air, the CPU got hot, and it throttled itself. Cleaning the dust fixed the slowness.
The network port turns one machine into a system. Everything after this lesson is about what happens when machines talk to each other. The port is the door. The lessons ahead are about the hallway.
At 10x the work, one machine is not enough. You add a second machine, and the network port becomes the bottleneck instead of the CPU. That is the moment a computer stops being a box and starts being a system.
At 100x, the box disappears from view. You rent machines by the hour and you never see them. But they are still boxes, with CPUs and memory and disks, sitting in a room somewhere. The parts never went away. They just moved out of sight.
Try it: the desk test. Run free -h now and write down the available number. Open your browser with five tabs and run it again. The number drops. Close the tabs and run it a third time. The number climbs back. That is the desk filling and emptying, and it is the fastest way to feel the memory gap in your own hands.
$ free -h
Mem: 7.7Gi 7.3Gi 124Mi 96Mi 671Mi 444Mi
$ df -h /
Filesystem Size Used Avail Use% Mounted on
overlay 7.5G 70M 7.5G 1% /
A machine would not turn on. No lights, no fan, nothing. The person using it was sure the machine had died. It had not. The power cable had worked loose from the back of the machine, just enough that it looked plugged in and was not.
Two things. First, I check power before I check anything else, every time, even when the problem looks complicated. Second, I never trust a cable that looks plugged in. I push it and feel the click. A loose cable and a dead machine look identical from the front.
A new team member needs a machine. She will write code, run a local database, and keep a lot of files. She works from home on Wi-Fi. Pick the parts: CPU, memory, disk, and network. Say how big each one should be and why.
Start with memory. An editor, a browser with many tabs, and a local database running at once need room. 16 GB is the floor here, 32 GB is comfortable. That is 16 times 1024 MB, or 16384 MB, on the desk. Disk: 512 GB is tight once files and programs pile up, so 1 TB is the sane pick. 1 TB is 1024 GB. CPU: a modern chip with 8 cores handles code and a local database without strain. Network: Wi-Fi is fine for her work, but a wired port helps when she moves large files.
More memory buys room for more programs at once and costs money. A bigger disk buys space for files and costs money. A faster CPU buys shorter waits and costs money and heat. Wi-Fi buys freedom to move and costs speed and reliability against a cable. The trade is that every part costs something, so I buy the parts her actual work needs, not the biggest of everything.