大网数据广告活动
服务器运维问答

MariaDB memory use rises beyond configured size

· 52CE 我爱测

I noticed a steady increase in system memory use %age (as reported by sar) which I've tracked to MariaDB. It's does not seem to be related to db load: this increase is notmatched by an increasing number of queries. I have the fol…

问题原文

原帖链接 · artfulrobot · CC BY-SA 4.0

I noticed a steady increase in system memory use %age (as reported by sar) which I've tracked to MariaDB. It's does not seem to be related to db load: this increase is notmatched by an increasing number of queries.

I have the following size configuration:

key_buffer_size         =  400000000                                                                                  
innodb_buffer_pool_size = 1210612736 

Total there is 1.5GB, yet it's now topped out at 2.3GB on RSS memory.

Why is it getting so greedy? Can I get it to stick to its limits better? Or perhaps it is sticking to the limits on InnoDB but is using memory for something else, if so, is there a way to understand that so that I can adjust the configuration to keep the total memory use within a certain level? Or perhaps it's like Linux kernel and just uses all free memory for caching while it's free, but happily relinquishes it as needed?

I'm on MariaDB 10.3.22 on Debian 10 (Buster). The workload is a webserver (so I need to keep some memory for other processes: nginx+php). Happy to post more config if required.

已采纳解答

原帖链接 · Gordan Bobić · CC BY-SA 4.0

The memory settings you listed are shared. There are also various buffers that are allocated per thread. Here is a link to a MySQL memory calculator:

https://www.mysqlcalculator.com/

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2020-06-10)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。