3 Basic Commands and Simple Shell Scripts Once you have your first Red Hat Enterprise Linux rhel



Download 1.85 Mb.
View original pdf
Page45/67
Date26.02.2024
Size1.85 Mb.
#63678
1   ...   41   42   43   44   45   46   47   48   ...   67
Pablo Iranzo Gómez, Pedro Ibáñez Requena, Miguel Pérez Colino, Scott McCarty - Red Hat Enterprise Linux 9 Administration-Packt Publishing (2022) -chap 3 82 - 180
local
stratum 3
orphan
With this directive, we’re setting the local stratum to 3 and we’re using the orphan option, which enables a special mode in which all servers with an equal local stratum are ignored unless no other source can be selected, and its reference ID is smaller than the local one. This means that we can set several NTP servers in our disconnected network, but only one of them will be the reference.
Now that we have covered time synchronization, we are going to dive into resource monitoring. Later, we’ll look at logging. All of this is related to our time reference for the system.
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.

Tools for Regular Operations
122
There are simple commands we can use to monitor the most basic use cases, such as the following ones Disk CPU Memory Network
This includes several ways of monitoring, such as one-shot monitoring, continuously, or even fora period of time to diagnose performance better.
Memory
Memory can be monitored via the free command. It provides details on how much random-access
memory
(RAM) and swap memory 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. You can see an example of this here:
# free
total used free shared buff/cache available
Mem: 823112 484884 44012 2976 294216 Swap 8388604 185856 In the preceding output, we can see that the system has a total of 823 megabytes (MB) of RAM and that it’s using some swap and some memory for buffers. This system is not swapping heavily as it’s almost idle (well check the load average later in this chapter, so we should not be concerned about it.
When RAM usage gets high and there’s no more swap available, the kernel includes a protection mechanism called Out-of-Memory Killer (OOM Killer). It determines based on time in execution, resource usage, and more—which processes in the system should be terminated to recover the system so that it’s functional. This, however, comes at a cost, as the kernel knows about the processes that may have gone out of control. However, the killer may kill databases and web servers and leave the system in an unstable state. For production servers, it is sometimes typical—instead of letting the
OOM-Killer start killing processes in an uncontrolled way—to either tune the values for some critical process so that those are not killed or to cause a system crash.

Checking for free resources – memory and disk (free and df A system crash is used to collect debug information that can later be analyzed via a dump containing information about what caused the crash, as well as a memory dump that can be diagnosed.
We will comeback to this topic in Chapter 16, Kernel Tuning and Managing Performance Profiles with tuned. Let’s move on and check the disk space that’s in use.
Disk space
Disk space can be checked via the df tool. df provides data as output for each filesystem. This indicates the filesystem and its size, available space, percent of utilization, and mount point.
Let’s check this in our example system, as follows:

Download 1.85 Mb.

Share with your friends:
1   ...   41   42   43   44   45   46   47   48   ...   67




The database is protected by copyright ©ininet.org 2024
send message

    Main page