Different CPU Times: Unix/Linux ‘top’

CPU consumption in Unix/Linux operating systems is studied using eight different metrics: User CPU time, System CPU time, nice CPU time, Idle CPU time, Waiting CPU time, Hardware Interrupt CPU time, Software Interrupt CPU time, Stolen CPU time. Let’s review each of the CPU time in this article.

User CPU Time and System CPU Time

In order to understand ‘user’ CPU Time, one should understand ‘system’ CPU time as well, since they go hand in hand. User CPU time is the amount of time the processor spends in running your application code. System CPU Time is the amount of time the processor spends in running the operating system(i.e., kernel) functions connected to your application. Let’s say your application is manipulating the elements in an array; then, it will be accounted as ‘user’ CPU time. Let’s say your application is making network calls to external applications. To make network calls, it has to read/write data into socket buffers which is part of the operating system code. This will be accounted as ‘system’ CPU time. To learn how to resolve high ‘user’ CPU time, refer to this article. To learn how to resolve high ‘system’ CPU time, refer to this article.

Don’t Try This at Home: The Dangers of DIY Toolchain Integration

Remember that time when your partner flagged a leak under the sink and suggested calling a plumber? "How hard can it be," you asked. A few grunts and speculative twists and bangs (and a few choice words) later, not to mention a generous application of duct tape, the leak had stopped. Disaster averted (at least until the problem resurfaced a few weeks later). And it was even worse that time. The kitchen flooded, causing more damage than Vesuvius.

DIY, unless you genuinely know what you’re doing, always comes at a cost. Sure, you can learn to become a better plumber. But plumbing is a specialty — and an expensive service — for a reason. On average, it takes nearly a decade to learn the ins and out of the trade.