zoukankan      html  css  js  c++  java
  • mysql优化参考(零)-监控参考

    1、show profile(s)  查看语句的整个执行时间片

      https://dev.mysql.com/doc/refman/8.0/en/show-profile.html

    • set profiling=1
    • show profile for query id
    • show profile cpu for query id

    2、show processlist    目前连接的客户端

    3、Performance:session级别,不参与主从拷贝等,实时监控;采用生产+消费模式

    https://dev.mysql.com/doc/refman/8.0/en/performance-schema-quick-start.html

      3.1、是否开启

    SELECT * FROM INFORMATION_SCHEMA.ENGINES
           WHERE ENGINE='PERFORMANCE_SCHEMA'G

      3.2、开启方式(仅可通过配置文件)

    [mysqld]
    performance_schema=ON

      3.3、常见的几种操作

    • 单表结构查询:SHOW CREATE TABLE performance_schema.setup_consumersG
    • 开启所有事件收集:
      • UPDATE performance_schema.setup_instruments SET ENABLED 'YES', TIMED 'YES';
      • UPDATE performance_schema.setup_consumers SET ENABLED 'YES';
    • 服务器当前做什么:SELECT * FROM performance_schema.events_waits_currentG
    • 文件操作实例:SELECT * FROM performance_schema.file_instancesG
    • 查看启用了哪些工具:SELECT NAME, ENABLED, TIMED FROM performance_schema.setup_instruments;

    四、查看状态

    show status;
    show status like '%innodb%';

    五、查看配置参数

    show variables;
    show variables like '%log%';
  • 相关阅读:
    HTML页面下echarts图形绘制
    nth-child的运用
    黑客零做起
    回溯法-背包问题
    回溯法-迷宫问题
    ECMA概述
    微信小程序-蓝牙
    JavaScript实现千位分隔符
    Vue 就地复用策略
    内联函数inline
  • 原文地址:https://www.cnblogs.com/gabin/p/13701248.html
Copyright © 2011-2022 走看看