码迷,mamicode.com
首页 > 数据库 > 详细

mysql 5.7 内存使用监控

时间:2017-04-10 11:17:37      阅读:294      评论:0      收藏:0      [点我收藏+]

标签:lte   mib   local   limit   .sql   没有   一点   ons   hand   

5.7 中的performance_schema 已经有能力监控mysql 的内存使用情况了,对于这一点也是要通过instrument 来实现的,由于内存这一块没有对应的consumer 所以只要

配置好instrument 就行了

 

1、例子:

/etc/my.cnf

[mysqld]
datadir                                    =/usr/local/mysql/data
basedir                                    =/usr/local/mysql
performance_schema_instrument              =‘memory%=counted‘

 

select event_name,current_alloc from sys.memory_global_by_current_bytes limit 10;
+-----------------------------------------------------------------------------+---------------+
| event_name                                                                  | current_alloc |
+-----------------------------------------------------------------------------+---------------+
| memory/innodb/buf_buf_pool                                                  | 131.06 MiB    |
| memory/innodb/log0log                                                       | 32.01 MiB     |
| memory/performance_schema/events_statements_history_long                    | 13.66 MiB     |
| memory/performance_schema/events_statements_history_long.sqltext            | 9.77 MiB      |
| memory/performance_schema/events_statements_history_long.tokens             | 9.77 MiB      |
| memory/performance_schema/events_statements_summary_by_digest.tokens        | 9.77 MiB      |
| memory/performance_schema/table_handles                                     | 9.06 MiB      |
| memory/performance_schema/events_statements_summary_by_thread_by_event_name | 8.67 MiB      |
| memory/mysys/KEY_CACHE                                                      | 8.00 MiB      |
| memory/performance_schema/memory_summary_by_thread_by_event_name            | 5.62 MiB      |
+-----------------------------------------------------------------------------+---------------+

  

mysql 5.7 内存使用监控

标签:lte   mib   local   limit   .sql   没有   一点   ons   hand   

原文地址:http://www.cnblogs.com/nsw2018/p/6687614.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!