zoukankan      html  css  js  c++  java
  • 数据库监控的指标


    1,慢查询
    show variables like '%slow%'
    show global status like '%long_query%'
    具体配置见文档
    mysqldumpslow -s at 10 slow.log


    2,连接数
    show variables like '%connections%'
    show status like '%thread%'
    其中:
    Threads_connected 当前打开的连接的数量
    Threads_cached 线程缓存内的线程的数量
    Threads_created 创建的线程数
    Threads_running 激活的(非睡眠状态)线程数

    show status like '%connection%'
    Connections 试图连接MySQL服务器的次数


    3,缓冲池
    show variables like '%buffer_pool_size%'
    show status like '%buffer%';
    其中:
    Innodb_buffer_pool_reads:缓冲池中没有读到数据,而从磁盘内读取的次数
    Innodb_buffer_pool_read_requests:来缓冲池中读数据的次数
    Innodb_buffer_pool_pages_total:缓冲池的总页数(内存是以页为单位)
    Innodb_buffer_pool_pages_free:缓冲池中处于空闲状态的页数

    命中率:innodb_buffer_read_hits=(1-Innodb_buffer_pool_reads/Innodb_buffer_pool_read_requests)*100%

    4,查询缓存 -- 了解
    show variables like '%query_cache%';
    show status like '%Qcache%'
    Query_cache_hits=(Qcache_hits/(Qcache_hits+Qcache_inserts))*100%

    5,线程缓存(连接池)-- 了解
    show variables like '%thread%'
    show status like 'connections'
    show status like '%thread%'
    Threads_Cache_Hit=(Connections-Threads_created)/Connections*100%

    6,表锁和行锁 -- 了解
    show status like '%lock%';
    存储引擎:早期mysql用的,MyISAM,现在都用Innodb
    MyISAM:支持表锁
    Innodb:支持行锁、支持事务

  • 相关阅读:
    JvisualVM、JMC监控远程服务器
    MVC学习笔记3
    MVC学习笔记2
    菜鸟级appium 必看
    关于redis一些问题记录
    git和github的区别
    VMware快照
    LR创建数据源读取excel
    mysql 5.7.18 源码安装笔记
    IDEA 配置Junit4
  • 原文地址:https://www.cnblogs.com/dwdw/p/10897469.html
Copyright © 2011-2022 走看看