On Thursday 14 February 2002 07:29, Peter Lovatt wrote:
> Hi
> Excuse the cross post
> I am thinking about building a logging tool to do visit analysis using SQL,
> rather than doing log file analysis.
> The aim is to analyse requests for dynamic pages called via php as well as
> static pages. Static pages will use an include for logging. Php calls may
> have two or three extra parameters which relate to products that are
> displayed (this is for ecommerce) which I also want to log. I am looking
> particularly at HTTP_REFERER, paths through the site, and most viewed
> products.
> Questions
> 1. Am I reinventing the wheel? and would it be better to buy a package
> (Spending money brings me out in a nasty rash, and leaves me feeling a
> little unsteady on my feet, but is sometimes the best option), or use a
> free one. The intended audience is non technical managerial type bods so
> nothing too difficult to understand :)

I would say you are :) Something like Analog would probably do all you need 
to do and more. But it doesn't use a database.

> 2. If I do use an existing package, are there any that are good with
> dynamic sites and the parameters passed to scripts, rather than just
> logging static pages?

Don't know.

> 3. Writing a database driven stats package on a medium traffic site (3-500
> visits a day, Average 8-12 pages per visit=6000 inserts a day, peaking at
> 2-3 per second ) will mean lots of inserts, and a few reads when the
> analysis is run. Running MySql on a 1.5GHz 512MB machine, is it better to
> leave the table unindexed and put up with slow analysis, or will the
> machine cope with indexes? The data could be aggregated periodically, but
> if possible left intact for up to a year to follow trends.

I've done something similar. In apache I pipe the logs through a little perl 
program which writes the info directly into an MySQL database. On one setup, 
a PII 300/448MB machine *easily* handles 10K requests a day. The table 
(indexed) is nearly up to 1 million rows and shows no (noticeable) signs of 
slowing down.

> 4. Is a (MySql?) database driven system a good answer, or just the wrong
> way to go??

Depends on how dynamic you want your analysis to be. And whether you can put 
up with long query times. In the above system some analysis can take up to 30 
secs to perform.

My reason for using a db was complete flexibility in analysing the data in 
any which way I want.

> Any thoughts and experience much appreciated before I commit to hours of
> work and gallons of coffee

Getting the info into the db is the easy part -- I could send you the perl 
script that I use. The hard bit is coming up with the necessary queries to 
extract the info from the db.

Jason Wong -> Gremlins Associates -> www.gremlins.com.hk

There's so much to say but your eyes keep interrupting me.

PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to