如何使用 top 和 free 来查看是什么导致了系统停滞?

如何使用 top 和 free 来查看是什么导致了系统停滞?

我无法从 top 获取输出,但我列出了许多 leafnode 实例。它们单独使用时并没有使用太多资源。也许从总体上讲,它们拖慢了系统。

演出日志/var/log/news/news.err

Dec 22 01:26:16 doge fetchnews[4121]: Cannot obtain lock file, aborting.
Dec 22 01:28:12 doge leafnode[3950]: Cannot write to client: Broken pipe
Dec 22 01:28:12 doge leafnode[3964]: Cannot write to client: Broken pipe
Dec 22 01:28:12 doge leafnode[3951]: Cannot write to client: Broken pipe
Dec 22 01:28:13 doge leafnode[3976]: Cannot write to client: Broken pipe
Dec 22 01:28:13 doge leafnode[3942]: Cannot write to client: Broken pipe
Dec 22 01:28:13 doge leafnode[3944]: Cannot write to client: Broken pipe
Dec 22 01:28:15 doge leafnode[3977]: Cannot write to client: Broken pipe
Dec 22 01:28:15 doge leafnode[3949]: Cannot write to client: Broken pipe
Dec 22 01:28:15 doge leafnode[3974]: Cannot write to client: Broken pipe
Dec 22 01:28:15 doge leafnode[3965]: Cannot write to client: Broken pipe
Dec 22 01:28:15 doge leafnode[3975]: Cannot write to client: Broken pipe
Dec 22 01:28:15 doge leafnode[3952]: Cannot write to client: Broken pipe
Dec 22 01:28:16 doge leafnode[3945]: Cannot write to client: Broken pipe
Dec 22 01:28:16 doge leafnode[3963]: Cannot write to client: Broken pipe
Dec 22 01:28:17 doge leafnode[3943]: Cannot write to client: Broken pipe
Dec 22 01:28:17 doge leafnode[3966]: Cannot write to client: Broken pipe
Dec 22 01:28:33 doge leafnode[3905]: Cannot write to client: Broken pipe
Dec 22 01:28:33 doge leafnode[3909]: Cannot write to client: Broken pipe
Dec 22 01:28:40 doge leafnode[3904]: Cannot write to client: Broken pipe
Dec 22 01:28:40 doge leafnode[3910]: Cannot write to client: Broken pipe
Dec 22 01:28:43 doge leafnode[3903]: Cannot write to client: Broken pipe
Dec 22 01:28:45 doge leafnode[3879]: Cannot write to client: Broken pipe
Dec 22 01:28:45 doge leafnode[3880]: Cannot write to client: Broken pipe
Dec 22 01:28:45 doge leafnode[3902]: Cannot write to client: Broken pipe
Dec 22 01:28:46 doge leafnode[3908]: Cannot write to client: Broken pipe
Dec 22 01:28:48 doge leafnode[3896]: Cannot write to client: Broken pipe
Dec 22 01:28:48 doge leafnode[3882]: Cannot write to client: Broken pipe
Dec 22 01:28:48 doge leafnode[3895]: Cannot write to client: Broken pipe
Dec 22 01:28:48 doge leafnode[3893]: Cannot write to client: Broken pipe
Dec 22 01:28:48 doge leafnode[3911]: Cannot write to client: Broken pipe
Dec 22 01:28:48 doge leafnode[3881]: Cannot write to client: Broken pipe
Dec 22 01:28:48 doge leafnode[3894]: Cannot write to client: Broken pipe
thufir@doge:~$ 
thufir@doge:~$ date
Thu Dec 22 01:36:22 PST 2016
thufir@doge:~$ 

不知道该怎么理解。有没有办法通过top或查看、或或使用资源free的程度?这三个程序是 leafnode NNTP 轻量级新闻服务器的一部分。实际上不应该那么密集。leafnodefetchnewstexpire

答案1

我发现顶部更加用户友好

sudo apt-get install htop

它将显示 CPU 和内存的使用情况,您可以按显示中的任何列进行排序。这可以让您更轻松地识别哪些程序/进程正在使用您的资源。

在此处输入图片描述

免费-m显示内存使用情况(单位:Mibibytes)。该列用过的对应大约到 htop 窗口头部显示的值(在 Ubuntu 16.04 LTS 之前的版本中用来更好地匹配的数据)。

$ free -m
              total        used        free      shared  buff/cache   available
Mem:           4041         869        1813          33        1358        2728
Swap:         16399           0       16399

相关内容