29 Feb 2012 10:47
High number of MySQL threads when using mod_log_sql
Hi there. I'm the admin for a very high volume website. Wie have 4 webservers which we use to distribute the load of our website. We would like to use mod_log_sql to log apache logs to a central MySQL database. So far, I've just enabled on of our webservers to log to a MySQL server running on a different host. What I find a bit worrying, is the number of MySQL threads which this causes. The one webserver I have logging to MySQL gets about 30-50 hits per second. And already this is causing about 150-200 MySQL server threads. The load on the MySQL server is extremely low. The host running the MySQL server is a 2x6 core Xeon Cpu with Hyperthreading, totalling 24 threads and equipped with 48GB of RAM. What I find puzzling is that our central MySQL Database Server, which we use as a backend for our website, uses only about 12-30 MySQL threads in total. Thats for all our webservers. Granted, this central database server uses SSD Harddrives for the database and handles 1500 Queries per second. But still. Is it normal for mod_log_sql to be using so many MySQL threads? Is there a way I could optimise this? Perhaps a tweak in the mysql server config or a parameter for mod_log_sql which I could try? I don't know if its gonna cause problems if MySQL has so many threads open. Especially considering that most of those seem to be "sleeping" when monitored with MyTOP.(Continue reading)
RSS Feed