对于 CentOS/RHEL 5 和 6
- 运行 TOP 命令:
# top
在键盘上按“f”键,然后按“p”键添加交换列,按回车键。
接下来,按大写“O”,然后是“p”按交换排序,按回车键。
根据需要执行检查,然后按“q”退出 top 命令。
问题:如何通过 top 命令查看 CentOS/RHEL 服务器上系统范围的交换使用情况,以识别最高消费者。
以下是 CentOS/RHEL 5 和 6 的步骤,它们是相同的,然后是 CentOS/RHEL 7,因为它们在此版本上有所不同:
注意:执行此任务不会对 top 命令造成任何更改,这只是在我们运行 top 命令时暂时发生的。
退出 top 并重新启动它会重置更改。
之路教程 https://onitr oad .com
对于 CentOS/RHEL 7
- 运行 TOP 命令:
# top
在键盘上按“f”键并使用 [向下] 箭头键向下滚动,直到我们选择了“交换”,然后按 [空格] 将其选中。
这应该在它前面添加一个“*”符号。在仍然选择“SWAP”的同时,按下 [right] 箭头键,它会突出显示整个 SWAP 行,然后使用 [top] 箭头键将其向上移动到第一个选项(“COMMAND”上方的任何位置)。
在仍然选择“SWAP”的同时,键入“s”键,它将按当前选择的选项(在本例中为 SWAP)配置 top 到 SORT。
当我们按“s”时,我们不会在屏幕上看到任何更改,但设置会保存在后端。最后按“q”保存配置更改并查看结果。
根据需要执行检查并再次按“q”退出 top 命令。
有关top选项和字段的更多信息,请查看手册页。
下面是top手册页中的几行,提供了有关内存字段及其代表的内容的一些信息。
# man top MEM -- Memory Usage (RES) A task's currently used share of available physical memory. RES -- Resident Memory Size (KiB) The non-swapped physical memory a task is using. SHR -- Shared Memory Size (KiB) The amount of shared memory available to a task, not all of which is typically resident. It simply reflects memory that could be potentially shared with other processes. SWAP -- Swapped Size (KiB) The non-resident portion of a task's address space. VIRT -- Virtual Memory Size (KiB) The total amount of virtual memory used by the task. It includes all code, data and shared libraries plus pages that have been swapped out and pages that have been mapped but not used.
日期:2020-09-17 00:13:16 来源:oir作者:oir