System running slow?

If so, your system will be either Memory, CPU, or I/O bound.

Memory, Compute (CPU), or I/O Bound?

Four hard drivers sticking out of a rack-mount server that’s being used as a NAS.

This can sometimes be due to software, but often, it’s the hardware that’s the culprit.

Think about it like pipes with water running through them.

For I/O, reading from slow hard drives as well as excessive disk writes can be the issue.

Article image

Shutterstock/solarseven

All you need ishtopandiotop, two semi-graphical tools, which can be easily installed on Linux.

Then look at the colorful CPU bars at the top of the screen.

If your processor has 16 threads, there will be 16 bars.

Installing htop and iotop

Simply look at the memory (Mem) and swap (Swp) bars mentioned earlier.

Once a system starts and continues swapping, it will become prohibitively slow.

It is easy to see when you start running out of memory, as the bar will become full.

A CPU Bound system htop output

However, the swap space usage can sometimes be a little ambiguous.

For example, 20% may be in use, but there is plenty of memory left.

As plenty of memory remains free, this situation is fine and not a cause of any concern.

A non-CPU bound system htop output

There is also an exception to a memory bar that looks quite full, and that is caching.

Your system may be set up to reserve x amount of memory for caching.

The used/free memory and swap bars look fine too.

free -g Output

Let’s checkout iotop next.

To do so, it’s crucial that you use

to startiotopas iotop requires sudo.

A few examples:

Is the systemDisk/IO bound?

A non-CPU bound system htop output

Is the systemMemory/Swap bound?

Is the systemCPU bound?

Use the bottom process list in htop to find the process which is hogging the CPU.

iotop showing current disk read and write throughput

you’ve got the option to even terminate it directly from within htop by using the F9 key.

If the issue is the CPU itself (i.e.

It may be time to upgrade the system overall.

More Than One Performance Bottleneck?

Both will need to be fixed before the system will become performant again.