MySQL processes slowing growing in size
Hi,My server has had memory problems recently, where my 1 gig of RAM would be totally consumed and would use hundreds of megs in SWAP resulting in a server crawl.
I've been making changes here and there regarding my apache and MySQL settings to improve performance and not kill the server memory wise. However, I am noticing this - mysql processes that slowly build in size over time.
Heres a copy of a Top script written my Edwin Loh at vbulletin.com:
Users online now = 315 (198 members + 117 guests)
Http processes currently running = 81
Mysql processes currently running = 49
8:12pm up 23:27, 0 users, load average: 1.77, 1.84, 1.66
177 processes: 175 sleeping, 2 running, 0 zombie, 0 stopped
Mem: 1023128K av, 935412K used, 87716K free, 0K shrd, 104372K buff
Swap: 2048276K av, 48432K used, 1999844K free 539064K cached
PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME COMMAND
6851 nobody 14 0 6616 6432 4148 S 22.5 0.6 0:01 httpd
6847 nobody 12 0 7192 7008 4660 S 11.7 0.6 0:01 httpd
15037 mysql 9 0 55812 54M 1452 S 0.9 5.4 0:52 mysqld
4780 nobody 9 0 7404 7220 4744 S 0.9 0.7 0:01 httpd
6924 nobody 10 0 6904 6720 4360 S 0.9 0.6 0:00 httpd
8174 nobody 10 0 1100 1100 828 R 0.9 0.1 0:00 top
3316 nobody 9 0 624 224 136 S 0.0 0.0 0:00 proftpd
2626 mysql 9 0 55812 54M 1452 S 0.0 5.4 0:15 mysqld
2630 mysql 9 0 55812 54M 1452 S 0.0 5.4 0:00 mysqld
2631 mysql 9 0 55812 54M 1452 S 0.0 5.4 0:02 mysqld
2634 mysql 9 0 55812 54M 1452 S 0.0 5.4 1:32 mysqld
2635 mysql 9 0 55812 54M 1452 S 0.0 5.4 1:35 mysqld
2636 mysql 9 0 55812 54M 1452 S 0.0 5.4 1:32 mysqld
2637 mysql 9 0 55812 54M 1452 S 0.0 5.4 1:32 mysqld
2638 mysql 9 0 55812 54M 1452 S 0.0 5.4 1:33 mysqld
2639 mysql 9 0 55812 54M 1452 S 0.0 5.4 1:33 mysqld
2640 mysql 9 0 55812 54M 1452 S 0.0 5.4 1:35 mysqld
2642 mysql 9 0 55812 54M 1452 S 0.0 5.4 1:32 mysqld
2643 mysql 9 0 55812 54M 1452 S 0.0 5.4 1:31 mysqld
2644 mysql 9 0 55812 54M 1452 S 0.0 5.4 1:33 mysqld
2645 mysql 9 0 55812 54M 1452 S 0.0 5.4 1:37 mysqld
4495 mysql 9 0 55812 54M 1452 S 0.0 5.4 1:29 mysqld
4523 mysql 9 0 55812 54M 1452 S 0.0 5.4 1:34 mysqld
24868 mysql 9 0 55812 54M 1452 S 0.0 5.4 1:28 mysqld
24871 mysql 9 0 55812 54M 1452 S 0.0 5.4 1:27 mysqld
27436 mysql 9 0 55812 54M 1452 S 0.0 5.4 1:28 mysqld
27440 mysql 9 0 55812 54M 1452 S 0.0 5.4 1:29 mysqld
27441 mysql 9 0 55812 54M 1452 S 0.0 5.4 1:25 mysqld
26142 mysql 9 0 55812 54M 1452 S 0.0 5.4 1:22 mysqld
26143 mysql 9 0 55812 54M 1452 S 0.0 5.4 1:22 mysqld
26145 mysql 9 0 55812 54M 1452 S 0.0 5.4 1:21 mysqld
12553 mysql 9 0 55812 54M 1452 S 0.0 5.4 1:13 mysqld
12557 mysql 9 0 55812 54M 1452 S 0.0 5.4 1:11 mysqld
32190 mysql 9 0 55812 54M 1452 S 0.0 5.4 0:59 mysqld
15017 mysql 9 0 55812 54M 1452 S 0.0 5.4 0:49 mysqld
15018 mysql 9 0 55812 54M 1452 S 0.0 5.4 0:51 mysqld
15019 mysql 9 0 55812 54M 1452 S 0.0 5.4 0:49 mysqld
15020 mysql 9 0 55812 54M 1452 S 0.0 5.4 0:49 mysqld
15021 mysql 9 0 55812 54M 1452 S 0.0 5.4 0:52 mysqld
15023 mysql 9 0 55812 54M 1452 S 0.0 5.4 0:51 mysqld
15024 mysql 9 0 55812 54M 1452 S 0.0 5.4 0:50 mysqld
15025 mysql 9 0 55812 54M 1452 S 0.0 5.4 0:48 mysqld
15026 mysql 9 0 55812 54M 1452 S 0.0 5.4 0:48 mysqld
15027 mysql 9 0 55812 54M 1452 S 0.0 5.4 0:49 mysqld
What I'm noticing is the "54M" in each mysql process slowly going up. It started in the low 16M's I believe, and has slowly risen. I dont know if it will continue to rise and cause total ram consumption.
Heres a copy of my.cnf:
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
skip-locking
skip-innodb
query_cache_limit=1M
query_cache_size=32M
query_cache_type=1
max_connections=500
interactive_timeout=100
wait_timeout=30
connect_timeout=10
thread_cache_size=64
key_buffer=16M
join_buffer=1M
max_allowed_packet=16M
table_cache=1024
record_buffer=1M
sort_buffer_size=1M
read_buffer_size=1M
max_connect_errors=10
# Try number of CPU's*2 for thread_concurrency
thread_concurrency=2
myisam_sort_buffer_size=16M
server-id=1
[mysql.server]
user=mysql
basedir=/var/lib
[safe_mysqld]
open_files_limit=8192
[mysqldump]
quick
max_allowed_packet=16M
[mysql]
no-auto-rehash
#safe-updates
[isamchk]
key_buffer=64M
sort_buffer=64M
read_buffer=16M
write_buffer=16M
[myisamchk]
key_buffer=64M
sort_buffer=64M
read_buffer=16M
write_buffer=16M
[mysqlhotcopy]
interactive-timeout
Thanks for any insight on the rising mysql usage per process!!