[Mod_log_sql] Delayed Inserts

Jay Fougere fougerej at ientry.com
Tue May 6 10:34:57 EDT 2008

I am currently running mod_log_sql 1.100 on several CentOS 5 servers 
which all log to a central MySQL (5.0.22) server.

My problem is that although I only keep 3days worth of logs in the 
database, the database files still grow to several gigabytes in size 
which is fine until I need to lock one of the tables. At this point, all 
of my sites are delayed because they cannot log due to a lock (whether 
it be for repair or what have you). This can take up to several minutes 
depending on the operation involved and of course, having high-traffic 
sites down for this period is unacceptable :)

After reading through the included documentation and searching on 
Google/Changelogs it appears as though using "Delayed Inserts" would 
solve this problem. All of the machines have large amounts of memory 
that is mostly not used at present (8GB+/machine); thus memory usage 
should be fine for the several minutes while these transactions take place.

According to the current documentation, "If you are experiencing issues 
which could be solved by delayed inserts, then set LogSqlDelayedInserts 
On in the httpd.conf . All regular INSERT statements are now INSERT 
DELAYED, and you should see no more blocking of the module."; However, 
LogSqlDelayedInserts seems to have been deprecated in version 1.106 
(according to the changelog) in favor of using LogSQLDBParam. I have 
read the documentation and Googled "LogSQLDBParam" but cannot find the 
proper method of enabling delayed inserts.

Thank you;

Jay Fougere
IT Manager, iEntry Inc.
ph: 859-514-2720
email: fougerej at ientry.com <mailto:fougerej at ientry.com>

More information about the Mod_log_sql mailing list