Checking for free resources – memory and disk (free and df)
In this section, you will check the availability of system resources such as memory and disk.
Keeping a system running smoothly means using monitoring so that we can check that the services are running and that the system provides the resources for them to do their tasks.
There are simple commands we can use to monitor the most basic use cases:
- Disk
- CPU
- Memory
- Network
This includes several ways of monitoring, such as one-shot monitoring, continuously, or even for a period of time to diagnose performance better.
Memory
Memory can be monitored via the free
command. It provides details on how much RAM and SWAP are available and in use, which also indicates how much memory is used by shares, buffers, or caches.
Linux tends to use all available memory; any unused RAM is directed toward caches or buffers and memory pages that are not being used. These are swapped out to disk if available...