Монитор ресурсов linux консоль

Monitor system resources on Oracle Linux

In this tutorial you work with the Oracle Linux vmstat , mpstat , and top to monitor system resource usage. Monitoring the usage of system resourses is useful for detecting issues which can adversely affect system performance.

Background

Oracle Linux provides tools for monitoring and analyzing system resource usage, as well as tracing tools for diagnosing performance issues in multiple processes and related threads.

Objectives

  • Explore the vmstat command
  • Explore the mpstat command
  • Explore the top command
  • Use vmstat and mpstat , and top
  • Examine command output from vmstat , mpstat , and top

What Do You Need?

A client system with Oracle Linux 8 or later installed.

Note: When using the free lab environment, see Oracle Linux Lab Basics for connection and other usage instructions.

Explore and Use vmstat Command Options

vmstat shows how much virtual memory there is and how much is free. The command also shows paging activity. You can observe page-ins and page-outs as they occur on the system.

You might consider maximizing your viewing area by using the Hide steps and the “Full screen” controls located in the task bar, as shown in the images.

Hide stepsHide steps

Watch the video below for an overview on vmstat .

  • The first two columns give information about processes:
    • r is the number of processes that are in a wait state. These are processes that are idle and waiting to run.
    • b is the number of processes that were in sleep mode, and were interrupted since the last update.
    • swpd is the amount of used virtual memory.
    • free is the amount of idle memory.
    • buff is the amount of memory used as buffers.
    • cache is the amount of memory used as cache.

    Nonzero si and so numbers indicate that there is not enough physical memory, which causes the kernel to swap memory to disk.

    • bi is the number of blocks per second received from a block device.
    • bo is the number of blocks per second sent to a block device.
    • in is the number of interrupts per second, including the clock.
    • cs is the number of context switches per second.
    • us is the percentage of CPU cycles spent on user processes.
    • sy is the percentage of CPU cycles spent on system (kernel) processes.
    • id is the percentage of CPU cycles spent idle.
    • wa is the percentage of CPU cycles spent waiting for I/O.
    • st is the percentage of CPU cycles stolen from a virtual machine.

    The count option tells vmstat the number of reports to run (4), and the delay option (7) is the time interval between each report.

    The -a option displays the amount of active and inactive ( inact ) memory in the memory section of the output.

    Explore and Use mpstat Command Options

    The mpstat command is used for collecting and displaying performance statistics for all logical CPUs in the system. When a CPU is occupied by a process, it is unavailable for processing other requests. These other processes must wait until the CPU is free.

    Watch the video below for an overview on mpstat .

    • CPU is the processor designated by the number starting at 0 or the keyword all indicating that statistics are calculated as averages among all processors.
    • %user is the percentage of CPU used while executing applications at the user level.
    • %nice is the percentage of CPU used while executing at the user level with nice priority.
    • %sys is the percentage of CPU used while executing at the system (kernel) level.

    This output prints a single line of activity for all CPUs and for each CPU. Note: mpstat also prints the average CPU utilization for the specified period.

    This output prints CPU utilization statistics for each CPU 5 times at an interval of 2 seconds. Note: that mpstat also prints the average CPU utilization for the specified period.

    Explore the top Command

    The top command provides an ongoing look at processor activity in real time. top displays a list of the most CPU-intensive processes or tasks on the system and provides a limited interactive interface for manipulating processes.

    Watch the video below for an overview on top .

      Run the top command without any options for a point-in-time view of the CPU activity.

Оцените статью
Adblock
detector