mysql8 内存占用大

查看占用情况:
SELECT SUBSTRING_INDEX(event_name,’/’,2) AS
code_area, FORMAT_BYTES(SUM(current_alloc))
AS current_alloc
FROM sys.x$memory_global_by_current_bytes
GROUP BY SUBSTRING_INDEX(event_name,’/’,2)
ORDER BY SUM(current_alloc) DESC;

关闭performance_schema,在/etc/my.cnf中添加
performance_schema=OFF
设置最大连接数,在/etc/my.cnf中添加:
max_connections=20

然后systemctl restart mysqld

MySQL8.0之内存消耗关键因素
https://cloud.tencent.com/developer/article/1800973
MySQL性能调优必知:Performance Schema引擎的配置与使用
https://www.cnblogs.com/xiaoxi-jinchen/p/17137240.html

您的感觉是什么
更新 2023年3月10日