Visit Our UNIX and Linux User Community


mysqld overloading cpu of VPS


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers mysqld overloading cpu of VPS
# 1  
Old 06-07-2011
mysqld overloading cpu of VPS

Hi bros
I have a VPS 512mb (Burst 2GB) with Kloxo installed and 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


Top output is as under

Code:
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


Last edited by pludi; 06-07-2011 at 05:35 AM..
# 2  
Old 06-07-2011
Have you checked the status of the tasks and queries MySQL is working on? Perhaps a query deadlock?

Code:
mysql> show processlist;
mysql> show full processlist;

Any relevant info in mysql error log, or mysql log?

Was this DB instance running fine in the past and it suddenly started eating up the whole CPU?

How many cores does your processor have?
# 3  
Old 06-08-2011
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
 

Previous Thread | Next Thread
Test Your Knowledge in Computers #282
Difficulty: Easy
Time-sharing operating systems schedule tasks for efficient use of the system and may also include accounting software for cost allocation of processor time, mass storage, printing, and other resources.
True or False?

10 More Discussions You Might Find Interesting

1. Programming

C++ operator overloading error

hi, I defined my own String class and overloaded the output operator with friend ostream& operator<<(ostream& os, const myString& str); //overloads the << operator so it can be used to output values of type myString which works fine. Until I try to execute the following statement: // +... (6 Replies)
Discussion started by: milhan
6 Replies

2. Homework & Coursework Questions

Mysql missing mysqld.sock (Linux)

I am trying to start a server for a class I am in but... mysql won't start with this error ( ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) ) ---------- Post updated at 03:51 PM ---------- Previous update was at 03:50 PM ---------- ... (2 Replies)
Discussion started by: Slayer939
2 Replies

3. Programming

PHP exec to restart mysqld

I want to do something very very bad. I want to create a button that restarts mysqld. Why is irrelevant for my issue. Here is my php script ... <?php if(isset($_POST)){ exec("sudo /etc/init.d/mysqld restart"); } ?> <form method="POST"> <input type="submit" name="restart"... (3 Replies)
Discussion started by: noPermissions
3 Replies

4. Red Hat

MySQL (mysqld) fails to start!

Hello, I have recently installed MySql and I encourage an error. I am using Fedora 15 and when I am trying to start mysqld service i am getting the following error message: Starting mysqld (via systemctl): Job failed. See system logs and 'systemctl status' for details. If I try to start it... (4 Replies)
Discussion started by: dot_pro
4 Replies

5. Programming

c++ assignment operator overloading

Hello everyone! Suppose that I have something like this A a; a.mem=new int; A b = a; where class A { public: int * mem; A() : mem(NULL) { } ~A() { if (mem!=NULL) delete mem; (1 Reply)
Discussion started by: bashuser2
1 Replies

6. Red Hat

comm: mysqld Not tainted ... Kernel Panic , System totally unresponsive

Hi, I am experiencing frequent system hangs, hard kernel panics, etc almost thrice a day. The system would be totally unresponsive and the only way is to reboot is hard power recycling (plug out the power cable and plug in back after 30 secs). I enabled kdump, but unfortunately the kdump files... (3 Replies)
Discussion started by: massoo
3 Replies

7. Programming

Delete operator overloading with multiple arguments.

Hi, I have an requirement to overload the delete operator in C++, but it should also accept the sizeof() the object that is to be deleted. Actually I am trying to built a custom memory allocator and deallocator like a pool, which makes me to overload the delete operator. Small example of the... (1 Reply)
Discussion started by: kapilkumawat
1 Replies

8. Programming

C++ Optr Overloading

Hi All, In C++ one operator can be overloaded, but it can't be overloaded by it's own derieved class Please let me know operator. Thanks, Naga:cool: (1 Reply)
Discussion started by: Nagapandi
1 Replies

9. AIX

xlC compilation error when dealing with operator overloading

Hi, I have a piece of C++ code that can be compiled using g++, but reports an error when compiled with xlC: xlC -DHAVE_CONFIG_H -I../SRC -I../include -DNoChange -DSPRNG_MPI -q64 -DLONG64=long -I/usr/lpp/ppe.poe/include -DLONG64=long -c -o libsprng_a-bignum.o bignum.cpp "bignum.cpp",... (1 Reply)
Discussion started by: luop0812
1 Replies

10. BSD

mysqld

Hello I installed mysql41 this is the end of the installation but when I try to launch the mysqld daemon it write this: note: LodelServoo is a CMS which need mysql I verify that the dir mysql existed under /var/db, but it doesn't so naively I created it and launch again the mysqld... (4 Replies)
Discussion started by: SoulCoder
4 Replies

Featured Tech Videos