791% CPU and a hypothesis one command refuted. How to measure what really loads a server, and what to try before new hardware.
The short answer
A heavily loaded server is a symptom, not a diagnosis. Before you pay for a bigger machine, check with one command which process uses the resources, and ask whether a bigger server even touches what is limiting you. Often it does not.
A symptom is not a cause
In Aelo, the SaaS platform where I am CTO, the server once showed 791% CPU. The first hypothesis was the obvious one: the background workers that do the heaviest lifting. One command refuted it, because the PostgreSQL database container was using the most, not the workers. The numbers in this post come from Aelo's server migration runbook.
Had the decision followed the hypothesis, I would have been fixing the wrong thing, and a bigger machine would have moved the same problem somewhere more expensive.
The first command: docker stats
If the app runs in containers, the first measurement is:
docker stats --no-stream
It prints one reading per container. I read three columns:
| Column | What I look for |
|---|---|
NAME | which container is on top, not which one I suspect |
CPU % | 100% is one full core, so a reading above 100% means several cores at once |
MEM USAGE / LIMIT | whether the container is close to its memory limit |
The same command is one of the positions in the read-only menu I built for the BlueCode server, so the measurement needs no shell access to the server.
When the database is on top, the next step is to find which queries load it, not to buy hardware.
What a bigger server changes, and what it does not
In Aelo a stronger machine raises one ceiling: more memory lets the database hold more connections (max_connections). It does not speed up the scans. Their pace is set by the token limit at the language model provider, not by the CPU.
I ask this question before every hardware purchase: what exactly limits me today, and is it a resource a bigger machine adds? If an external limit holds me back, a bigger server will simply wait longer.
Cheaper levers, in order of return
Aelo's runbook writes down the order before any hardware purchase:
- Narrow what creates the work. Narrowing the scope of one background service is half a day of work.
- Raise the limit at the provider. A higher account tier at the model provider raises what actually limits the scans.
- Spread the work over time. Instead of one morning window, the scans can run across a longer part of the day.
- Only then hardware.
Each of the first three steps costs less than moving to a new machine and carries no data migration risk.
When a bigger server is the answer
When the measurement shows that the machine itself is the limit and the cheaper levers are already used. Then a migration is justified by numbers, not by a hunch. If you want me to measure your application before you make that call, see the web apps service.
