60秒 Linux性能分析

简介

虽然很多人都有针对这个60秒性能分析的翻译,我依然要重写一遍,以加强记忆。

10个命令列表

在这里插入图片描述
上述的10个命令基本涵盖了cpu,内存,硬盘,网络以及内核错误等多个方面,能在短时间内快速评估系统以及进程的运行状态。这些命令需要安装sysstat包。

如果你记不住命令,那么请采用下图的宏观模式来辅助记忆,此图摘自另外一个强人RiboseYim
在这里插入图片描述

1. uptime

uptime gives a one line display of the following information.  The current time, how long the system has been running, how many users are currently logged on, and the system load averages for the past 1, 5, and 15 minutes.

System load averages is the average number of processes that are either in a runnable or  uninterruptable  state.   A  process  in  a runnable state is either using the CPU or waiting to use the CPU.  A process in uninterruptable state is waiting for some I/O access, eg waiting for disk.  The averages are taken over the three time intervals.  Load averages are not normalized for the number of  CPUs in a system, so a load average of 1 means a single CPU system is loaded all the time while on a 4 CPU system it means it was idle 75% of the time

当前用户数目以及最近1分钟,5分钟以及15分钟的系统平均负载。系统平均负载指的是处于runnable(运行进程或者就绪进程)或者uninterruptable(不可中断的等待进程)状态的平均的进程数目。

$ uptime
23:51:26up21:31, 1user, loadaverage:30.02,26.43,19.02

上面的这个例子表明负载在不断上升,因为最近1分钟的平均负载(30.02)大于最近15分钟的平均负载(19.02)。

2. dmesg | tail

用于给出最近的10条系统消息,有些错误可能会报告出来,例如下面的日子报告了进程18694出现了OOM错误。

$ dmesg | tail
[1880957.563150] perl invoked oom-killer: gfp_mask=0x280da, order=0, oom_score_adj=0
  • 0
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值