mysql 性能监控
1、监控thread_cache命中率
admin@localhost : (none) 07:51:20> show variables like '%thread%';
+---------------------------------------+---------------------------+
| Variable_name | Value |
+---------------------------------------+---------------------------+
| innodb_read_io_threads | 1 |
| innodb_thread_concurrency | 0 |
| innodb_thread_concurrency_timer_based | OFF |
| innodb_thread_sleep_delay | 10000 |
| innodb_use_purge_thread | 8 |
| innodb_write_io_threads | 16 |
| max_delayed_threads | 20 |
| max_insert_delayed_threads | 20 |
| myisam_repair_threads | 1 |
| pseudo_thread_id | 2919973 |
| thread_cache_size | 512 |
| thread_handling | one-thread-per-connection |
| thread_stack | 262144 |
| thread_statistics | OFF |
+---------------------------------------+---------------------------+
14 rows in set (0.00 sec)
说明:可以看出thread_cahce池中最大可以放512个连接线程,每个线程分配262144/512=512K内存空间
admin@localhost : (none) 07:50:50> show status like '%connection%';
+----------------------+---------+
| Variable_name | Value |
+----------------------+---------+
| Connections | 2920267 |
| Max_used_connections | 1008 |
+----------------------+---------+
2 rows in set (0.01 sec)
admin@localhost : (none) 07:51:08> show status like '%thread%';
+----------------------------+-------+
| Variable_name | Value |
+----------------------------+-------+
| Com_show_thread_statistics | 0 |
| Delayed_insert_threads | 0 |
| Slow_launch_threads | 0 |
| Threads_cached | 219 |
| Threads_connected | 790 |
| Threads_created | 2821 |
| Threads_running | 4 |
+----------------------------+-------+
7 rows in set (0.00 sec)
从上可以看出到目前为止服务器共有2920267 次连接,最大并发数为1008,当前thread_cahce中连接有219个,连接数为790个,共创建了2821次连接,当前活跃的有4个。
利用公式可以计算出thread_chace的命中率 :(Connections - Threads_created)/Connections *100=99.9%
2、监控innodb cache
admin@localhost : (none) 08:08:24> show status like '%innodb_buffer_pool_read%';
+---------------------------------------+--------------+
| Variable_name | Value |
+---------------------------------------+--------------+
| Innodb_buffer_pool_read_ahead_rnd | 0 |
| Innodb_buffer_pool_read_ahead | 1007126 |
| Innodb_buffer_pool_read_ahead_evicted | 938110 |
| Innodb_buffer_pool_read_requests | 643795018139 |
| Innodb_buffer_pool_reads | 24749326 |
+---------------------------------------+--------------+
5 rows in set (0.00 sec)
admin@localhost : (none) 08:08:32> show status like '%innodb_buffer_pool_wait%';
+------------------------------+-------+
| Variable_name | Value |
+------------------------------+-------+
| Innodb_buffer_pool_wait_free | 27 |
+------------------------------+-------+
1 row in set (0.00 sec)
admin@localhost : (none) 08:09:06> show variables like '%innodb_buffer%';
+---------------------------------+-------------+
| Variable_name | Value |
+---------------------------------+-------------+
| innodb_buffer_pool_shm_checksum | ON |
| innodb_buffer_pool_shm_key | 0 |
| innodb_buffer_pool_size | 23622320128 |
+---------------------------------+-------------+
3 rows in set (0.00 sec)
说明:1 - (Innodb_buffer_pool_reads/Innodb_buffer_pool_read_requests)=1 - 24749326/643795018139 =3.84 说明innodb cache的命中率并不怎么高。
mysql 性能监控的更多相关文章
- MySQL 性能监控 4 大指标
[编者按]本文作者为 John Matson,主要介绍 mysql 性能监控应该关注的 4 大指标. 文章系国内 ITOM 管理平台 OneAPM 编译呈现. MySQL 是什么? MySQL ...
- MySQL 性能监控4大指标——第二部分
[编者按]本文作者为 John Matson,主要介绍 mysql 性能监控应该关注的4大指标. 第一部分介绍了前两个指标:查询吞吐量与查询执行性能.本文将继续介绍另两个指标:MySQL 连接与缓冲池 ...
- MySQL 性能监控4大指标——第一部分
[编者按]本文作者为 John Matson,主要介绍 mysql 性能监控应该关注的4大指标. 第一部分将详细介绍前两个指标: 查询吞吐量与查询执行性能.文章系国内 ITOM 管理平台 OneAPM ...
- Mysql性能监控可视化
前言 操作系统以及Mysql数据库的实时性能状态数据尤为重要,特别是在有性能抖动的时候,这些实时的性能数据可以快速帮助你定位系统或Mysql数据库的性能瓶颈,镜像你在Linux系统上使用top.i ...
- mysql性能监控相关
目录 一,获取mysql用户下的进程总数 二,主机性能状态 三,CPU使用率 四,磁盘IO量 五,swap进出量[内存] 六,数据库性能状态 七.querylog 八.mysqladmin的exten ...
- mysql性能监控软件pmm
具体配置操作步骤:1.在vmware或者virtualbox上安装centos镜像,可以选择阿里巴巴的镜像,下载速度快 centos7 修改yum源为阿里源,某下网络下速度比较快 首先是到yum源设置 ...
- Mysql性能监控项及sql语句
推荐一款mysql监控软件MONyog 1.查询缓存: mysql> show variables like '%query_cache%'; 2.缓存在Cache中线程数量thread_cac ...
- Mysql 性能监控及调优
死锁概念: 两个或两个以上的进程在执行过程中,因争夺资源而造成的一种互相等待的现象 1.监控死锁(innotop): (1) 启用 innodb_status_file 在/etc/my.cnf添加如 ...
- myawr : mysql性能监控
myawr以mysql instance 为单位,每隔一段时间进行采样,然后把数据保存到数据库,以便分析.目前myawr脚本收集的信息包括5个部分: 1 系统方面的:负载.cpu.io.网络.swap ...
- Mysql性能监控
show processlist; show global variables like 'max_allowed_packet'; // QPS计算(每秒查询数)show global status ...
随机推荐
- Python Django Web开发的5个优秀好习惯
https://blog.csdn.net/weixin_42134789/article/details/82381854
- textarea跟随内容自动伸缩高度实现方案
监听input事件,然后将textarea的style.height设置为最低高度(19px),进而获取到元素的scrollHeight,然后将scroolHeight设置为style.height
- HDOJ-2011
#include<iostream> #include<cstdio> using namespace std; int main(){ int m,n,i; float su ...
- 学习node.js的一些笔记
最近看了几眼node.js,以前曾听说它用途很大. 在菜鸟教程上,已看了过半的内容:http://www.runoob.com/nodejs/nodejs-web-module.html,如今看到了这 ...
- vue页面传值
第一种情况:例:消息列表页(路由)跳转: methods: { goTo(){ this.$router.push({ name:'/My/Info', query:{ 'tellSeq':this. ...
- python--多线程多进程
一.进程 对于操作系统来说,一个任务就是一个进程(Process),比如打开一个浏览器就是启动一个浏览器进程,打开一个记事本就启动了一个记事本进程,打开两个记事本就启动了两个记事本进程.进程是很多资源 ...
- JSP动作标签flush属性值
在JSP动作标签<jsp:include flush="true"/>,flush属性可以为true或false.flush默认值为false,当把flush属性赋值为 ...
- Python3 NameError: name 'open' is not defined处理办法
一.说明 之前默认以为python的open方法用存哪里都没什么区别的,然后昨天直接在"__del__()"中使用今天同事跑程序时反馈程序报错“Python3 NameError: ...
- c++中各类型数据所占字节数(一)
转自: https://blog.csdn.net/hi_baymax/article/details/82415896 和机器字长及编译器有关系: 所以,int,long int,short int ...
- js promise中如何取到[[PromiseValue]]
返回的值Promise {[[PromiseStatus]]: "resolved", [[PromiseValue]]: "http://dl.stream.qqmus ...