At 5:52 PM -0500 9/18/99, Ken wrote:
>A simple minded question for you is why would you want to do this? What
>does such a config buy? Pardon moi, but it's not immediately apparent to
>me...
Putting log entries in a database lets you do database-like things with
them. :-)
You could bust up the entries into columns and figure out stuff like:
- how many hits per day, week, month, etc.
- how many hits per hour of the day
- how many hits come from each kind of web browser
- domain analysis - e.g., what percentage of your visitors come
from .edu, .com, .gov, etc. sites
- analyze refer(r)er entries to see how people are being steered to your
site
One problem that can occur with this kind of situation is that when
you log to a database, you'll have a constant stream of INSERT operations
hitting the table, particularly if you have a busy site (might be a good
reason to run the Web server and MySQL server on different hosts).
But when you perform log analysis, you'll be running SELECT statements
that have the potential to run for quite a while (relatively speaking),
and these will block INSERT operations. A way to alleviate this problem
for the log-generating client is to use INSERT DELAYED rather than just
INSERT, because that way the server will queue the row to be inserted
and the client can continue on its way. This will be more efficient
anyway, because the server will batch up a bunch of rows and insert
them as a block, which is more efficient than inserting each row
individually.
--
Paul DuBois, paul@stripped