[Mod_log_sql] High number of MySQL threads when using mod_log_sql
robert.krig at render-wahnsinn.de
Wed Feb 29 04:47:15 EST 2012
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
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.
The MySQL server I use for logging, is on its own and is only used for
I'm worried about adding our other apache servers into the mix.
Especially considering that the last two actually deal with 150-200 hits
per second each.
More information about the Mod_log_sql