top命令
显示进程所占的系统资源
每隔3秒变1次。把占用系统资源最高的进程放到最前面。
1[root@localhost ~]# top 2top - 03:56:02 up 3:46, 2 users, load average: 0.05, 0.03, 0.05 3Tasks: 105 total, 1 running, 103 sleeping, 1 stopped, 0 zombie 4%Cpu(s): 0.2 us, 0.0 sy, 0.0 ni, 99.8 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st 5KiB Mem : 1867048 total, 1513124 free, 156416 used, 197508 buff/cache 6KiB Swap: 2097148 total, 2097148 free, 0 used. 1522536 avail Mem 7 8 PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 9 1368 root 20 0 0 0 0 S 0.3 0.0 0:14.74 kworker/0:0 10 1 root 20 0 128164 6828 4056 S 0.0 0.4 0:01.65 systemd 11 2 root 20 0 0 0 0 S 0.0 0.0 0:00.03 kthreadd 12 3 root 20 0 0 0 0 S 0.0 0.0 0:00.07 ksoftirqd/0 13 5 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 kworker/0:0H 14 6 root 20 0 0 0 0 S 0.0 0.0 0:00.24 kworker/u256:0 15 7 root rt 0 0 0 0 S 0.0 0.0 0:00.01 migration/0 16 8 root 20 0 0 0 0 S 0.0 0.0 0:00.00 rcu_bh 17 9 root 20 0 0 0 0 S 0.0 0.0 0:01.95 rcu_sched 18 10 root rt 0 0 0 0 S 0.0 0.0 0:00.10 watchdog/0 19 11 root rt 0 0 0 0 S 0.0 0.0 0:00.10 watchdog/1 20 12 root rt 0 0 0 0 S 0.0 0.0 0:00.01 migration/1 21 13 root 20 0 0 0 0 S 0.0 0.0 0:00.07 ksoftirqd/1 22 15 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 kworker/1:0H 23 17 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kdevtmpfs 24 18 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 netns 25 19 root 20 0 0 0 0 S 0.0 0.0 0:00.00 khungtaskd 26 20 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 writeback 27 21 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 kintegrityd 28 22 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 bioset 29 23 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 kblockd
关注:RES这一项为进程所占内存的大小。
%MEM为使用内存的百分比。
nload 命令 监控网卡流量
出现错误如下所示:
1[root@localhost ~]# yum install -y nload 2已加载插件:fastestmirror 3Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=stock error was 414: curl#7 - "Failed connect to mirrorlist.centos.org:80; 没有到主机的路由" 5 6 7 One of the configured repositories failed (未知), 8 and yum doesn't have enough cached data to continue. At this point the only 9 safe thing yum can do is fail. There are a few ways to work "fix" this: 10 11 1. Contact the upstream for the repository and get them to fix the problem. 12 13 2. Reconfigure the baseurl/etc. for the repository, to point to a working 14 upstream. This is most often useful if you are using a newer 15 distribution release than is supported by the repository (and the 16 packages for the previous distribution release still work). 17 18 3. Run the command with the repository temporarily disabled 19 yum --disablerepo=<repoid> ... 20 21 4. Disable the repository permanently, so yum won't use it by default. Yum 22 will then just ignore the repository until you permanently enable it 23 again or use --enablerepo for temporary usage: 24 25 yum-config-manager --disable <repoid> 26 or 27 subscription-manager repos --disable=<repoid> 28 29 5. Configure the failing repository to be skipped, if it is unavailable. 30 Note that yum will try to contact the repo. when it runs most commands, 31 so will have to try and fail each time (and thus. yum will be be much 32 slower). If it is a very temporary problem though, this is often a nice 33 compromise: 34 35 yum-config-manager --save --setopt=<repoid>.skip_if_unavailable=true 36 37Cannot find a valid baseurl for repo: base/7/x86_64