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 ...
随机推荐
- linux与windows实现文件交互
Linux--用SecureCRT来上传和下载文件 SecureCRT下的文件传输协议有以下几种:ASCII.Xmodem.Ymodem.Zmodem ASCII:这是最快的传输协议,但只能传送文本文 ...
- channels 2.x的使用
转载:https://www.vimiix.com/post/2018/07/26/channels2-tutorial/ 认识 Channels 之前,需要先了解一下 asgi ,全名:Asynch ...
- Linux重要命令总结
tar命令后面最常跟的参数 -zxvf 是什么意思? z 表示 tar 包是被 gzip 压缩过的,所以解压时需要用 gunzip 解压 x 从 tar 包中把文件提取出来,单词extract的含义是 ...
- vue做nav切换
话不多说,直接上代码. 关键:通过点击来改变thisindex ,又thisinde == index来控制class是否含active来控制样式 简单效果如下:
- C# deep copy List
https://stackoverflow.com/questions/14007405/how-create-a-new-deep-copy-clone-of-a-listt 1. copy lis ...
- YOLT:将YOLO用于卫星图像目标检测
之前作者用滑动窗口和HOG来进行船体监测,在开放水域和港湾取得了不错的成绩,但是对于不一致的复杂背景,这个方法的性能会下降.为了解决这个缺点,作者使用YOLO作为物体检测的流水线,这个方法相比于HOG ...
- 略解TCP乱序和丢包
在使用基于TCP实现的各种组件的时候,我们经常会处理数据包.这数据包说来奇怪,从来不会丢失,也不会乱序,只会产生粘包.底层的机制是如何实现的呢?进来我们就来用简洁易懂的文字描述清楚. 在TCP数据包设 ...
- 【Python】Part1 应用1-Netcat
01 简介 netcat的主要功能是通过tcp或udp协议传输读写数据. 下面代码用python编写了tcp客户端,服务端,从而实现上传文件,本地执行命令,反弹shell三种功能. 02 代码 imp ...
- fflush 和 fsync 的区别
int fflush(FILE *stream);If stream points to an output stream or an update stream in which the most ...
- org.hibernate.ObjectNotFoundException: No row with the given identifier exists
维护老系统时出现的问题,出现的原因我简述一下: table1与table2是关联表,T1中有T2的主键 "T1_id",当T1中的 "T2_id" 不为null ...