The server is up, is normal that is up since hours (or days).
No problem on that.
For notice what is currently doing the MySQL Server you should think about use mytop.
Regards
Maybe a script uses persistent connections (mysql_pconnect())?
It's ok for dedicated servers with one site/purpose, but it's not advised on shared servers, unless it's a high spec server (like quad or multi-quad cpu, 12+ gb ram, etc)Yes, I think that can be. But it is not good, right?
It's ok for dedicated servers with one site/purpose, but it's not advised on shared servers, unless it's a high spec server (like quad or multi-quad cpu, 12+ gb ram, etc)
Do you have any other tool that can know what's happening inside a mysql process?
# mysqladmin processlist
mysql> SHOW FULL PROCESSLIST
To disable persistent connections, just use mysql_connect() instead.
You can also, very simply, set mysql.allow_persistent = Off in your php.ini file, then restart Apache, may need to restart MySQL too.
However, this could break things. My advice is to see what database is used, then you can reference it to the right account, and see the offending script.
Code:# mysqladmin processlist
http://dev.mysql.com/doc/refman/5.5/en/mysqladmin.html
Code:mysql> SHOW FULL PROCESSLIST
http://dev.mysql.com/doc/refman/5.1/en/show-processlist.html
[root@ns ~]# mysqladmin processlist
+-------+----------+-----------+----+---------+------+-------+------------------+
| Id | User | Host | db | Command | Time | State | Info |
+-------+----------+-----------+----+---------+------+-------+------------------+
| 48184 | da_admin | localhost | | Query | 0 | | show processlist |
+-------+----------+-----------+----+---------+------+-------+------------------+
mysql> SHOW FULL PROCESSLIST;
+-------+----------+-----------+------+---------+------+-------+-----------------------+
| Id | User | Host | db | Command | Time | State | Info |
+-------+----------+-----------+------+---------+------+-------+-----------------------+
| 48228 | da_admin | localhost | NULL | Query | 0 | NULL | SHOW FULL PROCESSLIST |
+-------+----------+-----------+------+---------+------+-------+-----------------------+
1 row in set (0.00 sec)
mysql>
If it's a connection from a PHP script, then with restarting Apache... it should be dropped.
And if you restart MySQL is the process still running?
Hold on, is this process named mysqld owned by root?No, if I restart mysql then it will be reset. It's just still there if mysql is not restarted.
Hold on, is this process named mysqld owned by root?
Should be root, unless it's changed recently?No, mysqld runs as "mysql", not by root.
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
23893 mysql 15 0 757m 413m 6016 S 4.3 5.2 1549:28 mysqld
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
27753 mysql 15 0 1165m 538m 4696 S 0.7 13.6 7963:26 mysqld
-------- Performance Metrics -------------------------------------------------
[--] Up for: 78d 11h 49m 0s (866M q [127.700 qps], 13M conn, TX: 2920B, RX: 204B)
[--] Reads / Writes: 74% / 26%
[--] Total buffers: 896.0M global + 9.6M per thread (140 max threads)
[OK] Maximum possible memory usage: 2.2G (56% of installed RAM)