解决docker部署mysql后,mysql占用内存过多的问题
查看内存占用
docker stats
更改配置
在/etc/my.cnf配置中,增加以下配置
ps: 建议将/etc/my.cnf挂载在宿主机已目录
#检测的表对象的最大数目
performance_schema_max_table_instances=400
#表定义缓存中表的个数
table_definition_cache=400
#表文件描述符的缓存大小
table_open_cache=256
重启mysql容器
docker restart mysql
相关文章
推荐: 浮生无事的博客
网友评论