jayb
Dec 4 2003, 05:17 PM
I am having issues with mySQL processes taking up all my memory.
6:15pm up 1:15, 1 user, load average: 0.07, 0.15, 0.24
176 processes: 174 sleeping, 1 running, 1 zombie, 0 stopped
CPU0 states: 11.1% user, 2.4% system, 0.0% nice, 85.3% idle
CPU1 states: 10.4% user, 2.1% system, 0.0% nice, 86.3% idle
CPU2 states: 10.0% user, 2.2% system, 0.0% nice, 87.1% idle
CPU3 states: 10.2% user, 1.1% system, 0.0% nice, 88.0% idle
Mem: 1547756K av, 1368204K used, 179552K free, 0K shrd, 46284K buff
Swap: 2048276K av, 0K used, 2048276K free 1108036K cached
PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME COMMAND
3700 mysql 9 0 33736 32M 1540 S 0.1 2.1 0:00 mysqld
3713 mysql 9 0 33736 32M 1540 S 0.0 2.1 0:00 mysqld
3714 mysql 9 0 33736 32M 1540 S 0.0 2.1 0:00 mysqld
3726 mysql 10 0 33736 32M 1540 S 0.1 2.1 0:10 mysqld
3742 mysql 9 0 33736 32M 1540 S 0.1 2.1 0:08 mysqld
3844 mysql 9 0 33736 32M 1540 S 1.3 2.1 0:10 mysqld
3957 mysql 9 0 33736 32M 1540 S 0.0 2.1 0:07 mysqld
4261 mysql 9 0 33736 32M 1540 S 0.1 2.1 0:12 mysqld
4512 mysql 9 0 33736 32M 1540 S 0.1 2.1 0:12 mysqld
5098 mysql 9 0 33736 32M 1540 S 0.0 2.1 0:06 mysqld
5711 mysql 9 0 33736 32M 1540 S 0.0 2.1 0:02 mysqld
7214 mysql 9 0 33736 32M 1540 S 0.0 2.1 0:02 mysqld
11682 mysql 9 0 33736 32M 1540 S 0.0 2.1 0:00 mysqld
2963 root 8 0 17008 16M 1580 S 0.0 1.0 0:00 spamd
This is just about 10 - 15 minutes after I rebooted the server.
Although in WHM when I click on "Show mySQL Processes" it shows between 0 to 7 Processes.
Why are there so many mySQL processes showing using the TOP command, and why are they ALL using the same amount of memory. Also the amount of memory used seems to increase while the server is up for several hours.
I have modified the mySQl config file for optimization as stated in previous threads, but still having memory issues on the box. As you can see above we now have 1.5gig of memory. We just increased it from 512mg.
Any ideas of what to look for?
Thank You,
Jayson Benoit
eth00
Dec 5 2003, 12:21 AM
Are you running something thats very mysql intensive, you might be lacking in CPU power.
I host forum that requires a dual xeon worth of processing power, a P4 2.4Ghz was not enough to serve all of the mysql stuff.
What is it that is using all of these resources, do you think its something running out of control or do you have some site/script that is justusing an insane amount of power/ram.
wadeee
Dec 5 2003, 02:38 AM
I have had similar trouble on one of our servers...
Clients were using the php Open Persistant Connection function and they were not being killed off...
Also.. the threads were getting huge.
You can put some limits into your /etc/my.cnf like
set-variable = max_connections=500
set-variable = wait_timeout=20
set-variable = interactive_timeout=20
set-variable = query_cache_limit=1M
set-variable = query_cache_size=32M
set-variable = query_cache_type=0
then restart mysql and see if that helps
jayb
Dec 5 2003, 06:24 AM
QUOTE
Originally posted by eth00
Are you running something thats very mysql intensive, you might be lacking in CPU power.
I host forum that requires a dual xeon worth of processing power, a P4 2.4Ghz was not enough to serve all of the mysql stuff.
What is it that is using all of these resources, do you think its something running out of control or do you have some site/script that is justusing an insane amount of power/ram.
I can't see a script running that is taking up that much memory. Th eissue I see is that a mySQL process that runs make take up a considerable amount of memory so then all the mysqld pid allocate that amount of memory. Then with 15 - 20 mysqld processes taking up 54M each that is killing my memory.
jayb
Dec 5 2003, 06:30 AM
QUOTE
Originally posted by wadeee
I have had similar trouble on one of our servers...
Clients were using the php Open Persistant Connection function and they were not being killed off...
Also.. the threads were getting huge.
You can put some limits into your /etc/my.cnf like
set-variable = max_connections=500
set-variable = wait_timeout=20
set-variable = interactive_timeout=20
set-variable = query_cache_limit=1M
set-variable = query_cache_size=32M
set-variable = query_cache_type=0
then restart mysql and see if that helps
I had those variables in the file. Here are the ones that were different and I changed to your specifications above:
wait_timeout=100
interactive_timeout=100
query_cache_type=1
eth00
Dec 5 2003, 01:41 PM
In WHM look at
"CPU/Memory/MySQL Usage"
see who is using so much cpu and see if you can find out what script is causing it. Since it sounds like you don't have much running something might just be going out of control.