[problem]
mysql keep using ram and swap , but it never releasing the memory until it out of memory
[environment]
physical machine: dell r710,32G RAM,16G SWAP,raid10,146G*6 disks
[mysql version]
Server version: 5.0.67-percona-highperf-log Source distribution ( we have another 4 mysql servers, only the 5th one has this problem)
[mysql basic configuration]
show variables like ‘%buffer%’;
±------------------------------±------------+
| Variable_name | Value |
±------------------------------±------------+
| bulk_insert_buffer_size | 67108864 |
| innodb_buffer_pool_awe_mem_mb | 0 |
| innodb_buffer_pool_size | 12884901888 |
| innodb_log_buffer_size | 16777216 |
| join_buffer_size | 2097152 |
| key_buffer_size | 67108864 |
| myisam_sort_buffer_size | 134217728 |
| net_buffer_length | 16384 |
| preload_buffer_size | 32768 |
| read_buffer_size | 1048576 |
| read_rnd_buffer_size | 16777216 |
| sort_buffer_size | 2097152 |
±------------------------------±------------+
free -mt
total used free shared buffers cached
Mem: 24094 24018 75 0 7 1959
-/+ buffers/cache: 22051 2042
Swap: 16386 11089 5296
Total: 40480 35108 5372
ps aux |grep mysql
root 19820 0.0 0.0 78484 1788 pts/0 S+ 22:41 0:00 mysql
root 22785 0.0 0.0 61156 664 pts/1 S+ 23:03 0:00 grep mysql
root 29703 0.0 0.0 65928 852 ? S Mar28 0:00 /bin/sh /usr/local/mysql/bin/mysqld_safe --datadir=/home/mysql --pid-file=/home/mysql/mysql.pid
mysql 29740 11.9 89.8 43209456 22163564 ? Sl Mar28 364:06 /usr/local/mysql/libexec/mysqld --basedir=/usr/local/mysql --datadir=/home/mysql --user=mysql --pid-file=/home/mysql/mysql.pid --skip-external-locking --port=3306 --socket=/home/mysql/mysql.sock
top
top - 23:04:09 up 3 days, 10:56, 2 users, load average: 0.07, 0.16, 0.17
Tasks: 136 total, 1 running, 135 sleeping, 0 stopped, 0 zombie
Cpu(s): 0.3%us, 0.1%sy, 0.0%ni, 99.4%id, 0.0%wa, 0.0%hi, 0.2%si, 0.0%st
Mem: 24672344k total, 24592592k used, 79752k free, 7320k buffers
Swap: 16779884k total, 11361564k used, 5418320k free, 2007552k cached
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
29740 mysql 15 0 41.2g 21g 42m S 3.0 89.8 364:06.35 mysqld
18325 root 16 0 87028 3308 2572 S 0.0 0.0 0:00.02 sshd
22532 root 15 0 86156 3300 2576 S 0.0 0.0 0:00.03 sshd
19820 root 16 0 78484 1788 1296 S 0.0 0.0 0:00.00 mysql
22534 root 15 0 68152 1652 1232 S 0.0 0.0 0:00.00 bash
18327 root 15 0 68152 1648 1232 S 0.0 0.0 0:00.02 bash
22795 root 15 0 12736 1100 816 R 0.0 0.0 0:00.01 top
29703 root 21 0 65928 852 848 S 0.0 0.0 0:00.00 mysqld_safe
29644 root 15 0 60672 696 568 S 0.0 0.0 0:01.77 sshd
28292 root 15 0 21640 684 588 S 0.0 0.0 0:02.29 xinetd
28743 root 16 0 74840 552 484 S 0.0 0.0 0:00.17 crond
thank u very much