MySql主要性能指标说明

Java102

在项目中,数据库通常会成为性能和负载的主要瓶颈。因此,监控和相应优化数据库的各种性能指标是开发和运维人员需要面对的主要任务,这部分工作将贯穿项目从开发到运营的整个周期。

[En]

In the project, the database will generally become the main bottleneck of performance and load. Therefore, the monitoring and corresponding optimization of various performance indicators of the database are the main tasks that the development and operation and maintenance personnel need to face, and this part of the work will run through the entire cycle of the project from development to operation.

这篇文章中我们对MySql数据库中的几个主要的性能指标的计算与统计进行下说明与总结。

在MySql中通过show global status可以得到很多的性能指标项,从中我们可以可以抽取需要关注的指标项:

1、CPU、内存使用率、磁盘占用空间

CPU、内存、磁盘这三项是我们能够看到的最直观的指标,也是MySql运行状态的整体体现,一旦我们的数据库服务器这三项出现不正常的波动,必然会影响项目的稳定与性能,从而就需要我们对项目与MySql进行合理配置与优化。

2 、创建的连接数、连接的连接数、连接缓存数、连接活跃数

Threads_created:

通过show global status like "Threads_created"可以查看已经创建的连接数,这个顾名思义就是MySql已经创建的总连接数;

Threads_connectd:

通过show global status like "Threads_connectd"可以查看已经连接的连接数,这个值等于show processlist;

输入验证码查看隐藏内容

扫描二维码关注本站微信公众号 Johngo学长
或者在微信里搜索 Johngo学长
回复 svip 获取验证码
wechat Johngo学长