Linux性能剖析的模型和方法

 

  1. CPU、内存和IO关系USE模型

  2. USE模型

  3. 吞吐率和延迟的特点

  4. 什么东西影响了吞吐率和延迟

  5. 各种各样的Linux剖析工具

  6. 火焰图

  7. All-in-one和阅码场开源项目LEP(Linux Easy Profiling)

Linux 做性能优化是一个 full stack 的工作,需要你非常了解 CPU  MEM  IO ,因为你不知道系统的瓶颈在哪里,你都不知道内存和IO交换的复杂的细节,

不理解什么时候会引入延迟,CPU 和 cache 直接 什么时候命中,什么时候 不命中,不理解IO是怎么被CPU访问的一个全过程,你对linux本身不是很了解的话,

你是不太可能会对性能做一个优化。

 

1、CPU、内存和IO关系USE模型

 再谈到性能分析的时候,经常会用到的一个模型就是 USE模型 :http://www.brendangregg.com/usemethod.html

The USE Method can be summarized as:

For every resource, check utilization, saturation, and errors.

It's intended to be used early in a performance investigation, to identify systemic bottlenecks.

Terminology definitions:

  • resource: all physical server functional components (CPUs, disks, busses, ...) [1]
  • utilization: the average time that the resource was busy servicing work [2]
  • saturation: the degree to which the resource has extra work which it can't service, often queued
  • errors: the count of error events

The metrics are usually expressed in the following terms:

  • utilization: as a percent over a time interval. eg, "one disk is running at 90% utilization".
  • saturation: as a queue length. eg, "the CPUs have an average run queue length of four".
  • errors: scalar counts. eg, "this network interface has had fifty late collisions".

这里解释一下 

utilization : 利用率

saturation:饱和度

 

本来这篇文章已经写完了,由于网络的原因,草稿丢失了,

以后再补回来吧

 

下面介绍一个开源分析的项目,非常推荐

可以在电路板上跑

https://github.com/linuxep/lepv

在PC Linux/WIN 下跑下面的

https://github.com/linuxep/lepd

之后你就可以实时看到你系统的CPU IO MEM  perf  火焰图等性能指标。

宋宝华:LEP(Linux易用剖析器) 是什么,为什么以及怎么办(1)

 

下面是Linux 性能分析方面的最权威的专家了:

http://www.brendangregg.com/index.html

https://github.com/brendangregg

宋宝华: Linux系统性能剖析的模型和方法

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值