Notes
  • Introduce
  • Go
    • Grammar
      • Basic
      • Goroutines & Channels
      • Test
    • System Library
      • Module
      • sync
      • context
      • net
    • Concurrency in Go
    • The Go Memory Model
    • Code Snippet
  • Rust
    • The Rust Programming Language
    • Rust by Example
  • JAVA
    • Preface
    • Grammar
      • Basic
      • Data Types
      • Operator
      • Exceptions
    • Class Libraries
      • Collection
      • Stream
      • IO
      • NIO
      • RMI
    • Concurrency
      • Preface
      • JMM
      • Synchronized & CAS
      • Deadlock
      • Thread
      • Lock & Condition
      • Utility Class
      • Thread-safe Collection
      • Atomic Class
      • Fork/Join
      • Concurrency Design Patterns
        • Immutable
        • Copy-on-Write
        • ThreadLocal
        • Multitheading If
        • Division
    • JVM
      • Class & Instance Initialization
      • Runtime Data Area
      • Garbage Collection
    • Web Container
      • Tomcat Architecture
      • Jetty Architecture
    • Spring
    • Tuning
      • Programming
  • Computer Science
    • Computer Organization
    • Algorithm
      • Complexity
      • Linear List
      • Sort
      • Binary Search
      • Skip List
      • Hash Table
      • Tree
      • Graph
      • String Matching
      • Bloom Filter
      • Greedy Algorithm
      • Divide and Conquer
      • Back Tracking
      • Dynamic Programming
    • Network Protocol
      • Pysical Layer
      • Data Link Layer
      • Network Layer
      • Transport Layer
      • Application layer
      • HTTP
      • HTTP/2 in Action
    • Operating System
      • Basic
      • System Initialization
      • Diagnostic Tools
      • CPU Diagnosis
      • Memory Diagnosis
      • Disk Diagnosis
      • Network Diagnosis
      • Monitor System
    • Design Patterns
      • UML
      • OOP
      • Principle
      • Refactoring & Specification
      • Creational
        • Singleton
        • Factory
        • Builder
        • Prototype
      • Structural
        • Proxy
        • Bridge
        • Decorator
        • Adapter
        • Facade
        • Composite
        • FlyWeight
      • Behavioral
        • Observer
        • Template Method
        • Strategy
        • State
        • Iterator
        • Chain of Responsibility
    • Distributed System
      • Protocol & Algorithm
      • Transcation
      • Theory
      • Resource Management
      • Scheduling
      • Computing
      • Message Queue
      • Cache
      • Consistent Hashing
  • database
    • InfluxDB
      • In-Memory Index
      • Meta
    • MySQL
      • SQL
      • Architecture
      • Log
      • Transaction
      • Indexing
      • Lock
      • Storage
    • Redis
    • Elasticsearch
      • Local Debug
    • HBase
    • Kafka
    • ZooKeeper
  • Reading
    • RocketMQ
    • 演说之禅
    • So Good They Can't Ignore You
    • 学会提问
    • Lecture
  • Other
    • v2ray
    • Kubernetes
    • Git
    • Maven
    • Anaconda And Conda
    • Fuck! Shit!
      • Remove Final by Reflection
      • Ingress Host
      • ExecuterService submit
  • Open source contribution
Powered by GitBook
On this page
  • USE 法
  • 系统监控
  • 应用监控

Was this helpful?

  1. Computer Science
  2. Operating System

Monitor System

PreviousNetwork DiagnosisNextDesign Patterns

Last updated 4 years ago

Was this helpful?

在性能分析时,很多时候发生性能瓶颈是突发的,到时候再登录机器场景已经消失了,所以需要通过监控、日志等方式保留现场。

USE 法

用于性能监控,Utilization Saturation and Errors。即使用率、饱和度、错误数。适用于系统监控。

USE 只关注提现系统性能瓶颈的指标。其它指标有时也很重要,如缓存、IOPS 等。

除了 USE 原则,还有偏重于应用的 RED 原则(适用于应用监控):Rate、Error、Duration。

系统监控

主要包括 CPU、内存、磁盘、文件系统、网络等。还有文件描述符、连接数、链接跟踪数等。

有很多开源的监控工具,如 Zabbix、Nagios、Prometheus,以 Prometheus 为例:

应用监控

适用于 RED 原则,即请求数、错误率、响应时间。RED 用于知道是否发生了性能问题,若要快速定位性能瓶颈,还需要如下监控:

  • 应用程序的资源使用情况,如进程占用的 CPU、内存、磁盘、网络等。

  • 应用程序之间的调用情况,如调用频率、错误数、延时等。

  • 应用程序内部核心逻辑的运行情况,如关键环节的耗时及错误。

由于业务系统通常涉及多个服务,性能复杂的调用链,所以可使用 Zipkin、Jaeger、Pinpoint 等工具构建全链路跟踪系统。

指标监控可以定位到性能瓶颈的位置,具体的性能问题有时还需要上下文,日志提供了上下文来源。指标适合实时监控,而日志适合历史问题查找。日志监控系统经典的就是 ELK(或 EFK)。