惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

D
DataBreaches.Net
GbyAI
GbyAI
aimingoo的专栏
aimingoo的专栏
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
月光博客
月光博客
大猫的无限游戏
大猫的无限游戏
M
MIT News - Artificial intelligence
腾讯CDC
博客园 - Franky
Engineering at Meta
Engineering at Meta
C
Check Point Blog
T
The Blog of Author Tim Ferriss
有赞技术团队
有赞技术团队
Microsoft Azure Blog
Microsoft Azure Blog
MyScale Blog
MyScale Blog
I
InfoQ
Blog — PlanetScale
Blog — PlanetScale
P
Proofpoint News Feed
The GitHub Blog
The GitHub Blog
N
Netflix TechBlog - Medium
Last Week in AI
Last Week in AI
S
SegmentFault 最新的问题
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
WordPress大学
WordPress大学

Jiajun的技术笔记

你好,2026! TiDB 源码阅读(六):TiDB Coprocessor 源码解析 性能优化的核心思想 TiDB 源码阅读(五):索引 TiDB 源码阅读(四):AST、逻辑计划、物理计划 CockroachDB Serverless Architecture podman 无故退出 Cursor Control-L (CTRL-L) Keyboard Shortcuts in Terminal Replace docker with podman Using xmonad with xfce4 A RC script for freebsd frpc 自己动手写一个k8s controller AI 会取代你的(编程)岗位吗? 自建DERP服务器提升Tailscale连接速度(使用Nginx转发) 自动升级Docker容器 再读《程序员修炼之道-从小工到专家》 让浏览器下载文件 再读《软件随想录》/《黑客与画家》/《软技能》 HTTP 压力测试中的 Coordinated Omission 2的补码 编程语言中的 context 是什么? flutter macOS 构建出错 Flatpak 使用小记 Golang CAS 操作是怎么实现的 PostgreSQL 当MQ来使用 Clash 结合 工作VPN 的网络设计 使用 PostgreSQL 搭建 JuiceFS PostgreSQL 配置优化和日志分析 有GitHub Copilot?那就可以搭建你的ChatGPT4服务 窗口函数的使用(以PG为例)
MySQL性能指标
Jiajun Huang · 2018-12-13 · via Jiajun的技术笔记

最近在魔改MySQL性能收集器 mysqld-exporter,接触到一些MySQL常见的性能指标,好好地记录下来学习学习:

SHOW GLOBAL STATUS 中:

  • Slow_queries 是慢查询的数量。具体的慢查询,还需要开慢查询日志(https://dev.mysql.com/doc/refman/5.7/en/slow-query-log.html):

    mysql [email protected]:(none)> show variables  like '%slow_query_log%';
    +---------------------+--------------------------------+
    | Variable_name       | Value                          |
    +---------------------+--------------------------------+
    | slow_query_log      | OFF                            |
    | slow_query_log_file | /var/lib/mysql/ubuntu-slow.log |
    +---------------------+--------------------------------+
    2 rows in set
    Time: 0.017s
    
  • Innodb_row_lock_current_waits 是InnoDB当前被等待的行锁的数量

  • Threads_connectedThreads_created 是当前打开的线程数和总共创建的线程数

  • Questions 是总共执行的语句数

  • Connections 是总共的连接数

  • Com_select, Com_insert, Com_update, Com_delete, Com_replace 则是分别对应 SELECT, INSERT, UPDATE, DELETE, REPLACE 语句的数量

  • Qcache_hits 是缓存命中量

  • Select_full_join 是全表连接的数量

SHOW VARIABLES\G 中:

  • max_connections 是最大连接数

SHOW SLAVE STATUS\G中:

  • Seconds_Behind_Master 是主从之间的延时

当然了,这些指标其实文档上全都有,但是很久不读文档,或者没有DBA那么熟悉文档的话,这样记录一下就还是有用的。


相关文章