List:General Discussion« Previous MessageNext Message »
From:Paul DuBois Date:September 19 1999 1:19am
Subject:Re: MySQL and Apache log
View as plain text  
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

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

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

Paul DuBois, paul@stripped
MySQL and Apache logDaniel Ouellet18 Sep
  • Re: MySQL and Apache logNicolas Ross18 Sep
    • Re: MySQL and Apache logKen19 Sep
      • Re: MySQL and Apache logPatrick Greenwell19 Sep
      • Re: MySQL and Apache logPaul DuBois19 Sep
        • Re: MySQL and Apache logKen19 Sep
          • RE: MySQL and Apache logBill Gerrard20 Sep
        • RE: MySQL and Apache logDaniel Ouellet19 Sep
          • RE: MySQL and Apache logMichael Widenius19 Sep
          • Re: MySQL and Apache logVan19 Sep
          • RE: MySQL and Apache logPaul DuBois19 Sep
    • Re: MySQL and Apache logVan19 Sep
    • Re: MySQL and Apache logSasha Pachev19 Sep
  • Re: MySQL and Apache logNicolas Ross19 Sep
    • RE: MySQL and Apache logTom Livingston19 Sep
      • Re: MySQL and Apache logMartin Ramsch19 Sep
    • Re: MySQL and Apache logKen19 Sep