When a Linux Server's Load Spikes at Midnight, This Is the Order We Usually Investigate In
2026-09-28 20:49:12
At two in the morning, the customer's operations group is shouting: the production line dashboard will not load. The system runs on a Linux server, and in the monitoring panel the load figure has already spiked past 40. We have taken this kind of call more than once, and when we get to the site, sometimes the machine really is busy, and sometimes it is just spinning its wheels. The handling direction for these two situations is completely opposite; if you judge wrong, restarting will not help.
1. First Distinguish Between "Genuinely Busy" and "Stuck"
Many people see a high load and assume the CPU cannot keep up, but that is not the same thing. The Linux load value counts both tasks that are running and tasks queued waiting for resources; a process stuck on disk reads and writes with no progress will still push the load up, while the CPU is actually quite idle. So the first thing to look at is not CPU usage, but whether those numbers are still climbing steadily or have already flattened out.

If the load stays high for a long time while CPU usage is very low, the trouble is most likely in the disk or in locks. Conversely, if the CPU is maxed out and the load rises with it, then something really is crunching away. This judgment takes less than two minutes, but the direction it points you in can be very different.
2. Investigate in a Fixed Order, Do Not Skip Steps
Our troubleshooting order is basically fixed. First use uptime to look at the load trend, then use top to pick out the processes eating the most resources, then use free to see whether memory and swap have been exhausted, then use iostat to look at disk read and write wait, and finally use ss to see whether the connection count is abnormal.
Once these five steps are done, the vast majority of problems reveal themselves. The order must not be scrambled, and the worst thing is to restart right away, which is the same as destroying the scene, and the problem will come back exactly as before next time. We once met a factory whose server kept freezing repeatedly, and the first few times they simply restarted; when Moges took over, we found that a log file had filled up one partition, and the process writing logs kept failing and retrying, dragging the load up. After deleting the old logs and configuring rotation properly, the problem never recurred.
3. The Most Common Real Culprits on Factory Servers
On servers running in factories, the causes of abnormal load come down to just a few. The most common is a full disk, especially the log directory and the database data directory; once a partition is full, many processes enter strange retry states, getting busier the more they retry. Next is slow database queries; a single SQL statement that does not use an index can max out the CPU, and it blows up as soon as business picks up during the day. Then there is swap thrashing caused by insufficient memory: the machine looks fine, but in reality it keeps using the hard disk as memory and becomes absurdly slow.
There is another category that is easy to overlook: scheduled tasks colliding. Jobs such as backup, reconciliation, and reporting are often scheduled in the same early-morning window; when several of them crowd together, disk and CPU are instantly pushed to the top. Staggering the times often eliminates more than half of the nighttime alerts.
4. Do a Few Things Right in Normal Times, and You Will Not Have to Get Up at Midnight
When deploying systems for customers, we have several standard actions. Logs must have rotation configured and a size limit set, and must never be allowed to grow without bound; disk, memory, and load must all be connected to monitoring, with alerts sent ahead of time when thresholds are exceeded, rather than waiting until the business reports errors to learn something is wrong; scheduled tasks must be spread out in time, not all piled onto the same moment.
With these preventive measures in place, more than half of emergency failures can be cut off, and what remains is the genuine unexpected incident that truly needs overnight handling. Since Moges was founded in Kunshan in 2012, the backends of PMS9 and PMS5 have run on Linux all along, and over 14 years the on-site servers of several hundred manufacturing customers in Suzhou and across Jiangsu have passed through our hands; this kind of troubleshooting is routine for us. Factories around Kunshan and Suzhou whose servers have problems in the middle of the night and cannot find anyone to look at them at short notice can ask Moges to take a look together.
Summary:
The first reaction to a load spike should not be to restart, but to first distinguish whether the machine is genuinely busy or just spinning its wheels, then look step by step in the order of load, CPU, memory, IO, and network. The common root causes on factory servers are just a few: a full disk, slow queries, swap thrashing, and colliding scheduled tasks. Do log rotation, monitoring alerts, and staggered task timing in advance, and many of those midnight calls will simply not come.
Related reading: Factory IT Services Overview classifies all these kinds of problems; under the same topic there are also Bringing the Production Line System Up in Minutes and A Record of 14 Years of Linux Server Operations.