Help - Search - Members - Calendar
Full Version: Mysqld process
The Planet Forums > System Administration > Web Hosting
ojedabarreto
Hi, please i need to know if i can kill the mysqld process wich has more than 11000 min.
Below i paste the TOP windows:

(This is web server)

Tasks: 185 total, 1 running, 183 sleeping, 0 stopped, 1 zombie
Cpu(s): 3.3% us, 1.3% sy, 0.0% ni, 95.2% id, 0.2% wa, 0.0% hi, 0.0% si
Mem: 1034500k total, 994748k used, 39752k free, 39156k buffers
Swap: 2031608k total, 120508k used, 1911100k free, 661432k cached

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
27952 mailnull 15 0 9412 2792 2320 S 1.3 0.3 0:00.32 exim
31852 nobody 15 0 19268 4448 1448 S 1.3 0.4 21:07.67 httpd
22753 nobody 15 0 19136 5404 2228 S 1.0 0.5 0:39.72 httpd
27182 nobody 15 0 19160 4836 1744 S 1.0 0.5 0:01.92 httpd
27799 nobody 15 0 18960 4612 1704 S 1.0 0.4 0:00.76 httpd
3022 mysql 15 0 126m 9280 2092 S 0.7 0.9 11515:38 mysqld
27454 root 16 0 3096 1052 764 R 0.7 0.1 0:00.79 top
439 root 15 0 0 0 0 S 0.3 0.0 50:25.07 kjournald
27185 siragon 16 0 3436 532 448 S 0.3 0.1 0:00.65 pop3d
27763 mailnull 15 0 9284 2004 1680 S 0.3 0.2 0:00.11 exim
27990 root 16 0 6324 4188 1356 S 0.3 0.4 0:00.09 tailwatchd
31851 nobody 16 0 19172 4384 1448 S 0.3 0.4 24:41.78 httpd
31863 nobody 17 0 19376 4600 1460 S 0.3 0.4 25:22.76 httpd
1 root 16 0 2104 180 152 S 0.0 0.0 2:27.09 init

Thank' in advance
Tomy Durden
QUOTE (ojedabarreto @ Aug 13 2009, 03:09 PM) *
Hi, please i need to know if i can kill the mysqld process wich has more than 11000 min.
Below i paste the TOP windows:

(This is web server)

Tasks: 185 total, 1 running, 183 sleeping, 0 stopped, 1 zombie
Cpu(s): 3.3% us, 1.3% sy, 0.0% ni, 95.2% id, 0.2% wa, 0.0% hi, 0.0% si
Mem: 1034500k total, 994748k used, 39752k free, 39156k buffers
Swap: 2031608k total, 120508k used, 1911100k free, 661432k cached

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
27952 mailnull 15 0 9412 2792 2320 S 1.3 0.3 0:00.32 exim
31852 nobody 15 0 19268 4448 1448 S 1.3 0.4 21:07.67 httpd
22753 nobody 15 0 19136 5404 2228 S 1.0 0.5 0:39.72 httpd
27182 nobody 15 0 19160 4836 1744 S 1.0 0.5 0:01.92 httpd
27799 nobody 15 0 18960 4612 1704 S 1.0 0.4 0:00.76 httpd
3022 mysql 15 0 126m 9280 2092 S 0.7 0.9 11515:38 mysqld
27454 root 16 0 3096 1052 764 R 0.7 0.1 0:00.79 top
439 root 15 0 0 0 0 S 0.3 0.0 50:25.07 kjournald
27185 siragon 16 0 3436 532 448 S 0.3 0.1 0:00.65 pop3d
27763 mailnull 15 0 9284 2004 1680 S 0.3 0.2 0:00.11 exim
27990 root 16 0 6324 4188 1356 S 0.3 0.4 0:00.09 tailwatchd
31851 nobody 16 0 19172 4384 1448 S 0.3 0.4 24:41.78 httpd
31863 nobody 17 0 19376 4600 1460 S 0.3 0.4 25:22.76 httpd
1 root 16 0 2104 180 152 S 0.0 0.0 2:27.09 init

Thank' in advance


login to the MySQL daemon and run "SHOW PROCESSLIST" to see if that thread doing anything. You can use the KILL command in MySQL to kill it. I wouldn't recommend killing it from your shell unless you have to.

If you do kill it, the transaction may roll back, which could revert some data(provided it got changed before the thread crashed).
ojedabarreto
QUOTE (Tomy Durden @ Aug 13 2009, 02:43 PM) *
login to the MySQL daemon and run "SHOW PROCESSLIST" to see if that thread doing anything. You can use the KILL command in MySQL to kill it. I wouldn't recommend killing it from your shell unless you have to.

If you do kill it, the transaction may roll back, which could revert some data(provided it got changed before the thread crashed).


Tomy, i just do that you recomend me but i continue with doubts because i coulnd't identify the ID process.
Please let me copy the result of "show processlist" and TOP command.
It is normal that a web server has many process on top for a long time like this?

consulta SQL:
SHOW PROCESSLIST
[ Editar ] [ Crear código PHP ] [ Actualizar ]



Textos completos Id User Host db Command Time State Info
Matar el proceso 10618595 name_user localhost name_v4 Sleep 222 NULL
Matar el proceso 10618875 root localhost mysql Query 0 NULL SHOW PROCESSLIS


TOP:
top - 16:23:01 up 189 days, 1:20, 2 users, load average: 0.49, 0.25, 0.15
Tasks: 163 total, 1 running, 161 sleeping, 0 stopped, 1 zombie
Cpu(s): 9.5% us, 4.2% sy, 0.0% ni, 86.4% id, 0.0% wa, 0.0% hi, 0.0% si
Mem: 1034500k total, 1003044k used, 31456k free, 36072k buffers
Swap: 2031608k total, 118724k used, 1912884k free, 752700k cached

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
7061 nobody 15 0 17928 3148 1624 S 10.3 0.3 0:05.88 httpd
3022 mysql 15 0 126m 9336 2108 S 10.0 0.9 11517:27 mysqld
7457 nobody 15 0 18676 4332 1716 S 2.3 0.4 0:00.52 httpd
6951 nobody 15 0 18920 4660 1768 S 1.7 0.5 0:00.33 httpd
29408 nobody 15 0 18676 4524 1808 S 1.0 0.4 0:05.29 httpd
31855 nobody 16 0 19356 4536 1472 S 0.7 0.4 22:16.20 httpd
5422 nobody 15 0 17792 1872 968 S 0.3 0.2 0:00.13 httpd
7521 root 16 0 3684 1040 764 R 0.3 0.1 0:00.18 top
1 root 16 0 2104 180 152 S 0.0 0.0 2:27.11 init
2 root RT 0 0 0 0 S 0.0 0.0 0:25.83 migration/0
3 root 34 19 0 0 0 S 0.0 0.0 0:02.72 ksoftirqd/0
4 root RT 0 0 0 0 S 0.0 0.0 0:13.32 migration/1
5 root 34 19 0 0 0 S 0.0 0.0 0:02.90 ksoftirqd/1
6 root 5 -10 0 0 0 S 0.0 0.0 0:01.93 events/0
7 root 5 -10 0 0 0 S 0.0 0.0 0:03.68 events/1
8 root 5 -10 0 0 0 S 0.0 0.0 0:00.01 khelper
9 root 15 -10 0 0 0 S 0.0 0.0 0:00.00 kacpid
20 root 5 -10 0 0 0 S 0.0 0.0 0:00.05 kblockd/0
21 root 5 -10 0 0 0 S 0.0 0.0 0:00.04 kblockd/1
22 root 15 0 0 0 0 S 0.0 0.0 0:00.00 khubd
41 root 15 0 0 0 0 S 0.0 0.0 37:12.04 kswapd0
42 root 10 -10 0 0 0 S 0.0 0.0 0:00.00 aio/0
43 root 10 -10 0 0 0 S 0.0 0.0 0:00.00 aio/1
187 root 25 0 0 0 0 S 0.0 0.0 0:00.00 kseriod
342 nobody 15 0 18888 4104 1472 S 0.0 0.4 27:21.76 httpd
344 nobody 15 0 19300 4620 1580 S 0.0 0.4 24:24.52 httpd
346 nobody 16 0 19348 5028 1844 S 0.0 0.5 24:39.60 httpd
347 nobody 15 0 19160 4528 1580 S 0.0 0.4 26:48.49 httpd
439 root 15 0 0 0 0 S 0.0 0.0 50:27.16 kjournald
1079 root 6 -10 0 0 0 S 0.0 0.0 0:00.00 kauditd
1257 root 15 0 0 0 0 S 0.0 0.0 0:00.07 pdflush
1679 root 16 0 8076 328 264 S 0.0 0.0 0:36.05 pure-ftpd
1682 root 15 0 8568 204 168 S 0.0 0.0 0:05.77 pure-authd
1820 root 19 0 0 0 0 S 0.0 0.0 0:00.00 kjournald
1875 root 15 0 2336 292 236 S 0.0 0.0 0:03.22 courierlogger
1876 root 16 0 2768 244 196 S 0.0 0.0 0:16.79 couriertcpd
1882 root 15 0 3112 288 236 S 0.0 0.0 0:04.25 courierlogger
1883 root 15 0 3380 252 196 S 0.0 0.0 0:03.31 couriertcpd
ojedabarreto
I mean, if the process is in TOP but is Mysql Process list, can i kill that process of mysql?
James Jhurani
QUOTE (ojedabarreto @ Aug 13 2009, 04:10 PM) *
I mean, if the process is in TOP but is Mysql Process list, can i kill that process of mysql?


I think you may be looking at this the wrong way.

QUOTE
top - 16:23:01 up 189 days, 1:20, 2 users, load average: 0.49, 0.25, 0.15


You have a low load average and high uptime. I'm willing to bet if you type "ps aux | grep mysql " the start date for the mysql process will be quite a while ago.

QUOTE
3022 mysql 15 0 126m 9280 2092 S 0.7 0.9 11515:38 mysqld


Since all of MySQL's child processes run under this parent process, what you are looking at is the total CPU time for this process and its children _since MySQL has been started_. This is not what it is currently being used. If your goal is just to reset that number "/etc/init.d/mysqld restart". But if you are alarmed because you think something is going on, rest assured, everything looks like it is functioning properly from here.
ojedabarreto
Tomy, ok. So, le tme copy the view of ps:

root@webserver [~]# ps aux |grep mysql
root 3001 0.0 0.0 5588 244 ? S Feb05 0:00 /bin/sh /usr/bin/mysqld_safe --datadir=/var/lib/mysql --pid-file=/var/lib/mysql/webserver.siragon.com.ve.pid
mysql 3022 4.2 0.6 129048 6324 ? Sl Feb05 11607:39 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --pid-file=/var/lib/mysql/webserver.siragon.com.ve.pid --skip-external-locking
root 25513 0.0 0.0 6308 656 pts/0 S+ 17:05 0:00 grep mysql
root@webserver [~]#

Well, i will forget it. However, i found this because i really was looking for an answer about a message that i am receiving lately from the server:

IMPORTANT: Do not ignore this email.
This is cPanel stats runner on webserver.siragon.com.ve!
While processing the log files for user "nameusr", the cpu has been maxed out for more than a 6 hour period. The current load/uptime line on the server at the time of this email is
02:35:12 up 190 days, 11:32, 0 users, load average: 2.12, 1.55, 1.42
You should check the server to see why the load is so high and take steps to lower the load. If you want stats to continue to run even with a high load; Edit /var/cpanel/cpanel.config and change extracpus to a number larger then 0 (run /usr/local/cpanel/startup afterwards to pickup the changes).

well, i have not check the server at that time but i changed the extracpu to 1 value but now a im receiving this message:
==> WARNING: The configured processor count does not match the
==> actual processor count (2)! Running log analysis programs
==> on this system may cause excessive load! You should set "extracpus"
==> to "0" in /var/cpanel/cpanel.config if this is not ok.

So , i was looking for the var proceesor count but i could not found it. So i changed the extracpu to 0 again.
Please, i have two days traing to understand what is happening but... may you help me about theses situations, please.




ojedabarreto
I apologize, i had to write: Tomy / James Jhurani ....
Thank's in advanced ...
James Jhurani
QUOTE (ojedabarreto @ Aug 15 2009, 05:18 PM) *
Tomy, ok. So, le tme copy the view of ps:

root@webserver [~]# ps aux |grep mysql
root 3001 0.0 0.0 5588 244 ? S Feb05 0:00 /bin/sh /usr/bin/mysqld_safe --datadir=/var/lib/mysql --pid-file=/var/lib/mysql/webserver.siragon.com.ve.pid
mysql 3022 4.2 0.6 129048 6324 ? Sl Feb05 11607:39 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --pid-file=/var/lib/mysql/webserver.siragon.com.ve.pid --skip-external-locking
root 25513 0.0 0.0 6308 656 pts/0 S+ 17:05 0:00 grep mysql
root@webserver [~]#

Well, i will forget it. However, i found this because i really was looking for an answer about a message that i am receiving lately from the server:

IMPORTANT: Do not ignore this email.
This is cPanel stats runner on webserver.siragon.com.ve!
While processing the log files for user "nameusr", the cpu has been maxed out for more than a 6 hour period. The current load/uptime line on the server at the time of this email is
02:35:12 up 190 days, 11:32, 0 users, load average: 2.12, 1.55, 1.42
You should check the server to see why the load is so high and take steps to lower the load. If you want stats to continue to run even with a high load; Edit /var/cpanel/cpanel.config and change extracpus to a number larger then 0 (run /usr/local/cpanel/startup afterwards to pickup the changes).

well, i have not check the server at that time but i changed the extracpu to 1 value but now a im receiving this message:
==> WARNING: The configured processor count does not match the
==> actual processor count (2)! Running log analysis programs
==> on this system may cause excessive load! You should set "extracpus"
==> to "0" in /var/cpanel/cpanel.config if this is not ok.

So , i was looking for the var proceesor count but i could not found it. So i changed the extracpu to 0 again.
Please, i have two days traing to understand what is happening but... may you help me about theses situations, please.


Yep, notice the start date in the "ps" is Feb... it is now Aug... So the CPU time seems fine.

cPanel uses this extracpus directive to decide how high it will allow your load average to go before it stalls all of its own processes. Most of the time the cause is backups, and stats running at a time that causes them to overlap. If the backups take 6+ hours to run, and your load average bounces back and forth over that threshold for 6 hours, you will get this message because there will inevitably be other processes waiting to run.

My suggestion is to set extracpus=4. It will run your server a little harder, but at the end of the day, now at least your server can complete everything. This number doesn't need to actually match the number of processors in the box. It is just a way to throttle how high you want to allow your load average to go, before cPanel starts stalling things.
ojedabarreto
Ok James, i just changed it... and i will forget the message about "not match". I will continue looking to understand more... thank's....
ojedabarreto
QUOTE (ojedabarreto @ Aug 18 2009, 06:16 AM) *
Ok James, i just changed it... and i will forget the message about "not match". I will continue looking to understand more... thank's....


Ah, my server has two cpu:

Processor Information

Processor #1 Vendor: GenuineIntel
Processor #1 Name: Intel® Xeon™ CPU 2.40GHz
Processor #1 speed: 2401.866 MHz
Processor #1 cache size: 512 KB

Processor #2 Vendor: GenuineIntel
Processor #2 Name: Intel® Xeon™ CPU 2.40GHz
Processor #2 speed: 2401.866 MHz
Processor #2 cache size: 512 KB
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.