HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   Server Operation (http://www.howtoforge.com/forums/forumdisplay.php?f=5)
-   -   mysqld: cpu overloaded (http://www.howtoforge.com/forums/showthread.php?t=52981)

rizwan65 7th June 2011 06:37

mysqld: cpu overloaded
 
Hi bros
I have a VPS 512mb (Burst 2GB) hosting few sites on it with not much traffic

I am facing high cpu load for the last few days and seems mysqld is overloading the cpu

Any suggestion will be appreciated
Regards
Rizwan

Sorry MODs I have submitted in wrong section please move to appropriate section

Top output is as under

top - 18:44:04 up 6 days, 12:19, 0 users, load average: 9.81, 8.44, 5.50
Tasks: 42 total, 2 running, 40 sleeping, 0 stopped, 0 zombie
Cpu(s): 32.0%us, 55.8%sy, 0.0%ni, 12.2%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Mem: 2097152k total, 496708k used, 1600444k free, 0k buffers
Swap: 0k total, 0k used, 0k free, 0k cached

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
25665 mysql 15 0 148m 41m 6904 S 215.2 2.0 29:22:14 mysqld
19929 apache 16 0 60792 30m 5104 S 6.6 1.5 0:07.50 httpd
1458 apache 15 0 59700 28m 4660 S 0.3 1.4 0:03.24 httpd
2044 apache 15 0 50920 19m 4100 S 0.3 0.9 0:01.31 httpd
1 root 15 0 2156 656 568 S 0.0 0.0 0:00.96 init
1987 apache 15 0 50920 19m 4100 S 0.0 0.9 0:00.91 httpd
2043 apache 16 0 50920 19m 4100 S 0.0 0.9 0:01.32 httpd
3155 apache 15 0 51200 19m 4412 S 0.0 1.0 0:00.64 httpd
3156 apache 16 0 50920 19m 4100 S 0.0 0.9 0:01.11 httpd
3646 apache 16 0 59196 28m 4908 S 0.0 1.4 0:03.81 httpd
5218 clamav 16 0 15388 1616 1012 S 0.0 0.1 0:00.31 freshclam
5981 lxpopuse 16 0 36408 31m 2484 S 0.0 1.6 0:03.21 spamd
7697 lxpopuse 15 0 39256 34m 2516 S 0.0 1.7 0:20.55 spamd
9484 apache 15 0 60560 29m 4968 S 0.0 1.5 0:04.14 httpd
13480 named 21 0 91508 4112 2044 S 0.0 0.2 0:13.39 named
17476 root 15 0 7188 1064 660 S 0.0 0.1 0:01.38 sshd
17492 root 15 0 2832 896 724 S 0.0 0.0 0:01.64 xinetd
21733 root 15 0 33856 29m 2416 S 0.0 1.4 0:07.96 spamd
21848 lxlabs 15 0 5580 932 500 S 0.0 0.0 0:00.20 kloxo.httpd
22441 root 15 0 26448 14m 4172 S 0.0 0.7 0:01.01 php
22462 root 15 0 11212 348 224 R 0.0 0.0 0:00.00 vzctl
22466 root 16 0 3708 1460 1236 S 0.0 0.1 0:00.01 bash
23643 root 15 0 49016 20m 7376 S 0.0 1.0 0:02.51 httpd
24010 root 15 0 2288 1016 816 R 0.0 0.0 0:00.00 top

till 7th June 2011 09:59

It might be that the host system of this vps is overloaded, so that I/O Bandwidth of the harddisk is the bottleneck. But thats only something that your provider can check.

What you can do in your vps is that you optimize mysql with mysqktuner:

http://www.faqforge.com/linux/optimi...th-mysqltuner/

rizwan65 8th June 2011 12:31

till thanks for your reply
Actually I started happening suddenly, it was running fine past

I have checked the processes and found one process in the state of (Copying to tmp table) of a script creating cpu load

1694 | db_user | localhost | db_name | Query | 1 | Copying to tmp table | SELECT tv.vid FROM `tag_video` AS tv, `tags` AS t WHERE tv.tag

These processes keep on increasing from 1 to 5 or more and cpu goes to above 200


All times are GMT +2. The time now is 12:08.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.