【发布时间】:2016-03-23 16:13:26
【问题描述】:
我最近在更新到最新版本 (Mariadb 10.1.9) 后重新启动了我的 MariaDB (Mysql) 服务器。但从那以后,我的 nagios 报告使用的内存不断增加,我无法弄清楚它来自哪里。
使用的内存已被 Nagios 记录为 150.000,并且目前还在不断增加。今天早上的请求显示 620.000 :
查询警告:'SELECT ROUND(VARIABLE_VALUE/1024/1024) FROM information_schema.GLOBAL_STATUS WHERE VARIABLE_NAME = "Memory_used"' 返回 620.000000
问题是否可能来自更新+重启,或者包更新后的不同配置文件或其他原因?
感谢您的帮助
更新
show variables like "%cache%"
Variable_name
Value
aria_pagecache_age_threshold
300
aria_pagecache_buffer_size
134217728
aria_pagecache_division_limit
100
aria_pagecache_file_hash_size
512
binlog_cache_size
32768
binlog_stmt_cache_size
32768
have_query_cache
YES
host_cache_size
279
innodb_disable_sort_file_cache
OFF
innodb_ft_cache_size
8000000
innodb_ft_result_cache_limit
2000000000
innodb_ft_total_cache_size
640000000
join_cache_level
2
key_cache_age_threshold
300
key_cache_block_size
1024
key_cache_division_limit
100
key_cache_file_hash_size
512
key_cache_segments
0
max_binlog_cache_size
18446744073709547520
max_binlog_stmt_cache_size
18446744073709547520
metadata_locks_cache_size
1024
query_cache_limit
1048576
query_cache_min_res_unit
4096
query_cache_size
1048576
query_cache_strip_comments
OFF
query_cache_type
OFF
query_cache_wlock_invalidate
OFF
stored_program_cache
256
table_definition_cache
400
table_open_cache
64
thread_cache_size
16
show variables like "%buffer%"
Variable_name
Value
aria_pagecache_buffer_size
134217728
aria_sort_buffer_size
268434432
bulk_insert_buffer_size
8388608
innodb_buffer_pool_dump_at_shutdown
OFF
innodb_buffer_pool_dump_now
OFF
innodb_buffer_pool_filename
ib_buffer_pool
innodb_buffer_pool_instances
8
innodb_buffer_pool_load_abort
OFF
innodb_buffer_pool_load_at_startup
OFF
innodb_buffer_pool_load_now
OFF
innodb_buffer_pool_populate
OFF
innodb_buffer_pool_size
134217728
innodb_change_buffer_max_size
25
innodb_change_buffering
all
innodb_log_buffer_size
16777216
innodb_sort_buffer_size
1048576
join_buffer_size
262144
join_buffer_space_limit
2097152
key_buffer_size
16777216
mrr_buffer_size
262144
myisam_sort_buffer_size
8388608
net_buffer_length
8192
preload_buffer_size
32768
read_buffer_size
262144
read_rnd_buffer_size
524288
sort_buffer_size
524288
sql_buffer_result
OFF
show variables like "%max_connections%"
Variable_name
Value
extra_max_connections
1
max_connections
151
【问题讨论】:
-
能否也包括缓存和缓冲区变量?您还可以使用 mysqltuner 检查 MySQL 的最大配置内存使用量。
-
是否有很多查询在一夜之间运行?操作系统(例如,“top”)是否也说 mysqld 大约有 620M?所有表中大约有多少数据(总计)?
-
@mihaly-vukovics 究竟是哪些变量,来自 information_schema ?我不得不重新启动我的 mysqld 服务器,因为该值变得至关重要,也许我需要等到使用的内存再次上升才能向您显示这些变量。
-
@rick-james 我只有几个数据库:Custom 11Mo,MediaWiki:127Mo,Prestashop:155Mo,Redmine:20Mo = 313 Mo。一些查询通过机器人爬行在 mediawiki 上运行,但没有什么疯狂的,因为通常我会期待。我刚刚重新启动了 mysqld,所以我稍后会检查“top”。
-
show variables like "%cache%";