Only single process of mysqld running all the time with mysql 5.1

thunn

Verified User
Joined
Mar 13, 2012
Messages
166
Dear Supporter,
I have upgraded my system to use MySQL 5.1, but I check and all the time I get this only:
Code:
[root@xxx]# ps aux | grep mysqld
root      3560  0.0  0.0   4112   712 pts/1    S+   02:43   0:00 grep mysqld
root     20912  0.0  0.0   4632  1232 ?        S    Aug24   0:00 /bin/sh /usr/bin/mysqld_safe --datadir=/var/lib/mysql --pid-file=/var/lib/mysql/xxx.com.pid
mysql    21057  9.6 17.3 1165596 404804 ?      Sl   Aug24  82:23 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --log-error=/var/lib/mysql/xxx.com.err --pid-file=/var/lib/mysql/xxx.com.pid

And in DirectAdmin control panel:
mysqld mysqld (pid 21057 ) Start Stop

And this is the result of mysqladmin processlist:
Code:
[root@xxx]# mysqladmin processlist |wc -l
5
[root@xxx]# mysqladmin processlist
+--------+------------------+-----------+-----------------+---------+------+-------+------------------+
| Id     | User             | Host      | db              | Command | Time | State | Info             |
+--------+------------------+-----------+-----------------+---------+------+-------+------------------+
| 109853 | xxx_db | localhost | xxx_user | Sleep   | 0    |       |                  |
| 109854 | da_admin         | localhost |                 | Query   | 0    |       | show processlist |
+--------+------------------+-----------+-----------------+---------+------+-------+------------------+

So, can I have some info about this?

Thank you.
 
What's the problem? My servers always have 1 process.
=> What's your MySQL version?

In my old MySQL version 5.0.67, I saw that it has many processes running as "mysql".

After upgrade to mysql5.1 then it show only one.


try:

ps -ALf|grep mysql

This is the result:
Code:
[[email protected] etc]$ ps -ALf|grep mysql
root      6511     1  6511  0    1 Aug26 ?        00:00:00 /bin/sh /usr/bin/mysqld_safe --datadir=/var/lib/mysql --pid-file=/var/lib/mysql/xxxxxxx.com.pid
mysql     6692  6511  6692  0   31 Aug26 ?        00:00:06 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --log-error=/var/lib/mysql/xxxxxxx.com.err --pid-file=/var/lib/mysql/xxxxxxx.com.pid --socket=/var/lib/mysql/mysql.sock --port=3306
mysql     6692  6511  6694  0   31 Aug26 ?        00:00:00 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --log-error=/var/lib/mysql/xxxxxxx.com.err --pid-file=/var/lib/mysql/xxxxxxx.com.pid --socket=/var/lib/mysql/mysql.sock --port=3306
mysql     6692  6511  6695  0   31 Aug26 ?        00:00:00 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --log-error=/var/lib/mysql/xxxxxxx.com.err --pid-file=/var/lib/mysql/xxxxxxx.com.pid --socket=/var/lib/mysql/mysql.sock --port=3306
mysql     6692  6511  6696  0   31 Aug26 ?        00:00:00 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --log-error=/var/lib/mysql/xxxxxxx.com.err --pid-file=/var/lib/mysql/xxxxxxx.com.pid --socket=/var/lib/mysql/mysql.sock --port=3306
mysql     6692  6511  6697  0   31 Aug26 ?        00:00:00 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --log-error=/var/lib/mysql/xxxxxxx.com.err --pid-file=/var/lib/mysql/xxxxxxx.com.pid --socket=/var/lib/mysql/mysql.sock --port=3306
mysql     6692  6511  6699  0   31 Aug26 ?        00:00:00 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --log-error=/var/lib/mysql/xxxxxxx.com.err --pid-file=/var/lib/mysql/xxxxxxx.com.pid --socket=/var/lib/mysql/mysql.sock --port=3306
mysql     6692  6511  6700  0   31 Aug26 ?        00:00:00 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --log-error=/var/lib/mysql/xxxxxxx.com.err --pid-file=/var/lib/mysql/xxxxxxx.com.pid --socket=/var/lib/mysql/mysql.sock --port=3306
mysql     6692  6511  6701  0   31 Aug26 ?        00:00:00 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --log-error=/var/lib/mysql/xxxxxxx.com.err --pid-file=/var/lib/mysql/xxxxxxx.com.pid --socket=/var/lib/mysql/mysql.sock --port=3306
mysql     6692  6511  6702  0   31 Aug26 ?        00:00:00 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --log-error=/var/lib/mysql/xxxxxxx.com.err --pid-file=/var/lib/mysql/xxxxxxx.com.pid --socket=/var/lib/mysql/mysql.sock --port=3306
mysql     6692  6511  6708  0   31 Aug26 ?        00:00:00 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --log-error=/var/lib/mysql/xxxxxxx.com.err --pid-file=/var/lib/mysql/xxxxxxx.com.pid --socket=/var/lib/mysql/mysql.sock --port=3306
mysql     6692  6511  6714  0   31 Aug26 ?        00:03:59 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --log-error=/var/lib/mysql/xxxxxxx.com.err --pid-file=/var/lib/mysql/xxxxxxx.com.pid --socket=/var/lib/mysql/mysql.sock --port=3306
mysql     6692  6511  6727  0   31 Aug26 ?        00:04:00 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --log-error=/var/lib/mysql/xxxxxxx.com.err --pid-file=/var/lib/mysql/xxxxxxx.com.pid --socket=/var/lib/mysql/mysql.sock --port=3306
mysql     6692  6511  6728  0   31 Aug26 ?        00:03:52 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --log-error=/var/lib/mysql/xxxxxxx.com.err --pid-file=/var/lib/mysql/xxxxxxx.com.pid --socket=/var/lib/mysql/mysql.sock --port=3306
mysql     6692  6511  6736  0   31 Aug26 ?        00:03:56 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --log-error=/var/lib/mysql/xxxxxxx.com.err --pid-file=/var/lib/mysql/xxxxxxx.com.pid --socket=/var/lib/mysql/mysql.sock --port=3306
mysql     6692  6511  6737  0   31 Aug26 ?        00:04:36 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --log-error=/var/lib/mysql/xxxxxxx.com.err --pid-file=/var/lib/mysql/xxxxxxx.com.pid --socket=/var/lib/mysql/mysql.sock --port=3306
mysql     6692  6511  6778  0   31 Aug26 ?        00:03:51 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --log-error=/var/lib/mysql/xxxxxxx.com.err --pid-file=/var/lib/mysql/xxxxxxx.com.pid --socket=/var/lib/mysql/mysql.sock --port=3306
mysql     6692  6511  6779  0   31 Aug26 ?        00:03:56 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --log-error=/var/lib/mysql/xxxxxxx.com.err --pid-file=/var/lib/mysql/xxxxxxx.com.pid --socket=/var/lib/mysql/mysql.sock --port=3306
mysql     6692  6511  6990  0   31 Aug26 ?        00:03:55 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --log-error=/var/lib/mysql/xxxxxxx.com.err --pid-file=/var/lib/mysql/xxxxxxx.com.pid --socket=/var/lib/mysql/mysql.sock --port=3306
mysql     6692  6511  6991  0   31 Aug26 ?        00:04:10 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --log-error=/var/lib/mysql/xxxxxxx.com.err --pid-file=/var/lib/mysql/xxxxxxx.com.pid --socket=/var/lib/mysql/mysql.sock --port=3306
mysql     6692  6511  7080  0   31 Aug26 ?        00:03:56 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --log-error=/var/lib/mysql/xxxxxxx.com.err --pid-file=/var/lib/mysql/xxxxxxx.com.pid --socket=/var/lib/mysql/mysql.sock --port=3306
mysql     6692  6511  7081  0   31 Aug26 ?        00:03:47 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --log-error=/var/lib/mysql/xxxxxxx.com.err --pid-file=/var/lib/mysql/xxxxxxx.com.pid --socket=/var/lib/mysql/mysql.sock --port=3306
mysql     6692  6511  7082  0   31 Aug26 ?        00:03:51 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --log-error=/var/lib/mysql/xxxxxxx.com.err --pid-file=/var/lib/mysql/xxxxxxx.com.pid --socket=/var/lib/mysql/mysql.sock --port=3306
mysql     6692  6511 12774  0   31 Aug26 ?        00:03:11 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --log-error=/var/lib/mysql/xxxxxxx.com.err --pid-file=/var/lib/mysql/xxxxxxx.com.pid --socket=/var/lib/mysql/mysql.sock --port=3306
mysql     6692  6511 12775  0   31 Aug26 ?        00:03:19 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --log-error=/var/lib/mysql/xxxxxxx.com.err --pid-file=/var/lib/mysql/xxxxxxx.com.pid --socket=/var/lib/mysql/mysql.sock --port=3306
mysql     6692  6511 12782  0   31 Aug26 ?        00:03:13 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --log-error=/var/lib/mysql/xxxxxxx.com.err --pid-file=/var/lib/mysql/xxxxxxx.com.pid --socket=/var/lib/mysql/mysql.sock --port=3306
mysql     6692  6511 12798  0   31 Aug26 ?        00:03:13 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --log-error=/var/lib/mysql/xxxxxxx.com.err --pid-file=/var/lib/mysql/xxxxxxx.com.pid --socket=/var/lib/mysql/mysql.sock --port=3306
mysql     6692  6511 20665  0   31 Aug26 ?        00:02:03 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --log-error=/var/lib/mysql/xxxxxxx.com.err --pid-file=/var/lib/mysql/xxxxxxx.com.pid --socket=/var/lib/mysql/mysql.sock --port=3306
mysql     6692  6511 20666  0   31 Aug26 ?        00:01:59 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --log-error=/var/lib/mysql/xxxxxxx.com.err --pid-file=/var/lib/mysql/xxxxxxx.com.pid --socket=/var/lib/mysql/mysql.sock --port=3306
mysql     6692  6511 20667  0   31 Aug26 ?        00:02:00 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --log-error=/var/lib/mysql/xxxxxxx.com.err --pid-file=/var/lib/mysql/xxxxxxx.com.pid --socket=/var/lib/mysql/mysql.sock --port=3306
mysql     6692  6511 20668  0   31 Aug26 ?        00:02:05 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --log-error=/var/lib/mysql/xxxxxxx.com.err --pid-file=/var/lib/mysql/xxxxxxx.com.pid --socket=/var/lib/mysql/mysql.sock --port=3306
mysql     6692  6511 20669  0   31 Aug26 ?        00:02:21 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --log-error=/var/lib/mysql/xxxxxxx.com.err --pid-file=/var/lib/mysql/xxxxxxx.com.pid --socket=/var/lib/mysql/mysql.sock --port=3306

Can you give me some advise?

Thank you.
 
Well, wat kind of advise do you want?

Your server simple has one main mysql process running under the root user but queries are handled by multiple threads, spawned from the main process, running under the mysql user. This is pretty much normal behaviour, but when mysqld is compiled with the linux_threads library (if I remember correctly) it will show many more main processes, instead of 'hiding' the threads.

Actually this linux_threads issue is something used on FreeBSD to get better performance. I'm not really sure if it's worth the trouble nowadays as it's much cheaper to buy some more ram/cpu power than recompiling and documenting your non-standard mysql install (think 'updating'). Well, at least not for the majority of mysqlbased systems.

If you're using Linux, forget about linux_threads completely because you're not going to outperform Linux with pthreads on FreeBSD with linux_threads anyway.
 
Yes, your explanation is advise for me, very useful.

Thank you Sysdev
 
Back
Top