zoukankan      html  css  js  c++  java
  • MySQL数据库维护中监控所用到的常用命令(转载)

    status = show status like ‘%%' [例:show status like 'Com_select']
    variables = show variables like ‘%%' [例:show variables like 'query_cache_size']

    1、MySQL查询次数(取自show status返回信息)
    Com_select;Com_update;Com_insert;Com_delete;Com_change_db

    2、查询缓存空间大小:query_cache_size
    查询缓存最大查询数据集大小:query_cache_limit(variables);(取自show variables返回信息)
    缓存中的查询个数:Qcache_inserts(status);(取自show status返回信息)
    查询缓存命中率:(Qcache_hits/(Qcache_hits+Qcache_inserts))*100% (status)(取自show status返回信息)

    3、索引缓存命中率
    索引缓存空间大小:key_buffer_size (variables)(取自show variables返回信息)
    索引缓存命中率:(Key_reads/Key_read_requests)*100% (status)(取自show status返回信息)

    4、并发连接数
    最大充许连接数:max_connections(variables)(取自show variables返回信息)
    服务器启动后已经同时使用的连接的最大数量(相当于历史记录):max_used_connections(status)(取自show status返回信息)
    当前连接数:Threads_connected(status)(这个参数和running的区别在于,它是连接上了数据库,但是未对mysql进行操作)(取自show status返回信息)
    活跃连接数:Threads_running(status)(这个数值指的是激活的连接数,这个数值一般远低于connected数值{非并发情况下},学习的时候一直把Threads_connected当作并发数,后来发现错了,这个参数的意义可以理解为连接上了数据库并对mysql进行了操作,相当于show processlist里state不为sleep)(取自show status返回信息)
    缓存连接数:Threads_cache(status)(取自show status返回信息)

    5、流量统计(取自show status返回信息)
    Bytes_received(接受的字节数) ,Bytes_sent(发送的字节数)

    6、连接次数(取自show status返回信息)
    试图连接到(不管是否成功)MySQL服务器的连接数:Connections(status)
    每秒实际创建连接次数:Threads_created(status)

    7、表锁定统计(取自show status返回信息)
    立即释放的表锁数:Table_locks_immediate(status)
    需要等待的表锁数:Table_locks_waited(status)

    查询时间超过long_query_time秒的查询的个数:Slow_queries(慢查询)(取自show status返回信息)

    long_query_time是设置的时间(默认2秒)(取自show variables返回信息) 即超过2秒的查询为慢查询

  • 相关阅读:
    TCP的发送缓冲区和接收缓冲区
    【 Linux 】单台服务器上并发TCP连接数(转)
    Mosquitto----服务器日志
    Mqtt ----心跳机制
    class文件无论是32位还是64位jdk编译出来的,都可以通用
    启动eclipse时出现“Failed to load the JNI shared library jvm.dll”错误及解决-及eclipse版本查看
    Ant编译提示“Unsupported major.minor version 52.0”
    HanLP自然语言处理包介绍
    Lazarus安装使用
    Java中字符串转为16进制表示
  • 原文地址:https://www.cnblogs.com/tudou1223/p/4446911.html
Copyright © 2011-2022 走看看