Mysql内存占用太高,8G被耗光了。
数据库有500多个表,都会被频繁的使用。
数据库运行一段时间就会发现,8G的内存竟然会被吃光了。配置文件使用的是默认的my-medium.cnf文件。
希望大虾能够提示,这个问题应该从哪些方面考虑解决。
谢谢
数据库版本信息:
Server version: 5.1.46-log Source distribution
my.cnf文件,去除了中间部分注释
# Example MySQL config file for medium systems.
#
# This is for a system with little memory (32M - 64M) where MySQL plays
# an important part, or systems up to 128M where MySQL is used together with
# other programs (such as a web server)
#
# You can copy this file to
# /etc/my.cnf to set global options,
# mysql-data-dir/my.cnf to set server-specific options (in this
# installation this directory is /usr/local/mysql/var) or
# ~/.my.cnf to set user-specific options.
#
# In this file, you can use all long options that a program supports.
# If you want to know which options a program supports, run the program
# with the "--help" option.
# The following options will be passed to all MySQL clients
[client]
#password = your_password
port = 3306
socket = /tmp/mysql.sock
# Here follows entries for some specific programs
# The MySQL server
[mysqld]
port = 3306
socket = /tmp/mysql.sock
skip-locking
key_buffer_size = 16M
max_allowed_packet = 1M
table_open_cache = 64
sort_buffer_size = 512K
net_buffer_length = 8K
read_buffer_size = 256K
read_rnd_buffer_size = 512K
myisam_sort_buffer_size = 8M
# Replication Master Server (default)
# binary logging is required for replication
log-bin=mysql-bin
# binary logging format - mixed recommended
binlog_format=mixed
server-id = 1
[mysqldump]
quick
max_allowed_packet = 16M
[mysql]
no-auto-rehash
# Remove the next comment character if you are not familiar with SQL
#safe-updates
[myisamchk]
key_buffer_size = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M
[mysqlhotcopy]
相关推荐
MySql减少内存占用的方法详解
主要介绍了MySql减少内存占用的方法详解,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友可以参考下
轻量级工业物联网平台实战:从设备接入到告警推送的完整方案
工业物联网是智能制造数字化转型的关键基础设施,其核心价值在于打通现场设备层与信息管理层的数据链路。对于车间级、产线级的中小规模场景,大型平台往往过于复杂笨重,而轻量级解决方案通过合理的架构设计与技术选型,在部署成本、维护复杂度和功能完整性之间取得平衡。基于设备接入、数据存储、可视化监控、告警引擎与权限安全等核心模块,可以快速构建一套真正可落地、可维护的工业物联网管理后台。此类系统采用Docker Compose一键部署,支持Modbus、MQTT等常见协议接入,配合时序数据库与WebSocket实时推送,既
MySQL占用内存较大与CPU过高测试与解决办法
为了装mysql环境测试,装上后发现启动后MySQL占用内存了很大,达8百多兆。网上搜索了一下,得到高人指点my.ini。再也没见再详细的了..只好打开my.ini逐行的啃,虽然英文差了点,不过多少M还是看得明的
mySQL占用虚拟内存达8百多兆问题解决思路
为了装mysql环境测试,装上后发现启动后mysql占用了很大的虚拟内存,达8百多兆。网上搜索了一下,得到高人指点my.ini。再也没见再详细的了..只好打开my.ini逐行的啃,虽然英文差了点,不过多少M还是看得明的^-^ 更改后如下: innodb_buffer_pool_size=576M ->256M InnoDB引擎缓冲区占了大头,首要就是拿它开刀 query_cache_size=100M ->16M 查询缓存 tmp_table_size=102M ->64M 临时表大小 key_buffer_size=256m ->32M 重启mysql服务后,虚拟内存降到200以下. 另外m
Mysql5.6启动内存占用过高解决方案
vps的内存为512M,安装好nginx,php等启动起来,mysql死活启动不起来看了日志只看到对应pid被结束了,后跟踪看发现是内存不足被killed;mysql5.6启动内存占用过高怎么办呢,下面小编给大家解答下


