The server is not responding and the top output shows the following: mysql is consuming more than 500% of CPU
Will the server restart solve ths issue? Will I face the same problem after restart?
# top
top - 06:30:38 up 82 days, 17:43, 1 user, load average: 117.87, 105.81, 85.65
Tasks: 328 total, 27 running, 299 sleeping, 0 stopped, 2 zombie
Cpu(s): 0.1%us, 99.4%sy, 0.0%ni, 0.0%id, 0.0%wa, 0.0%hi, 0.0%si, 0.5%st
Mem: 35847720k total, 35823272k used, 24448k free, 788k buffers
Swap: 0k total, 0k used, 0k free, 39552k cached
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
15661 mysql 21 0 1192m 282m 904 R 550.8 0.8 1304:06 mysqld
118 root 17 -5 0 0 0 D 69.4 0.0 27:03.12 kswapd0
26835 root 18 0 10992 936 416 R 62.8 0.0 0:13.51 top
26831 root 19 0 72872 864 224 R 37.2 0.0 0:07.18 php
26881 root 18 0 79944 1528 228 R 18.3 0.0 0:04.96 php
Update:
I added myisam key buffer to 8 GB, query cache to 100MB and table cache to 256 dynamically (without adding it to my.cnf) on a 34 GB box. This made the box unresponsive within a day.
I restarted the mysql service and the problem is still there.
Does the memory gets fragmented because of changing this setting dynamically?
Do I need to restart server?