NYCPHP Meetup

NYPHP.org

[nycphp-talk] PHP Solution for Website stats

Rolan Yang rolan at omnistep.com
Thu Jun 3 12:53:25 EDT 2004


Actually, it would be quite easy to import. You would only need a 5 line 
shell
script  which sliced and diced the existing logs. Then a mysql query to 
"load data infile into table blag_logs".

For low bandwidth sites, I don't see a problem with mod_log_sql, however 
if you are
serving lots of pages, you could quickly saturate your network or disk 
i/o bandwidth (depending
on if your mysql is on the same machine or another).

As an example, I'm hosting a pretty high traffic phpBB for someone right 
now. Sometimes
the site is hit with like 30+ page requests/sec. PhpBB is quite a hog 
and when people are viewing
a page full of posts that contain 100+smiley icons, etc (each one 
counting as a hit) you can
easily run up like 3000 hits/sec. Each hit is an entry in the apache 
log... Now if you had mod_log_sql
running, your server would have to manage 3000+ mysql inserts per sec.. 
that would place a serious
load not only on your disk i/o but also cpu. What makes matters worse 
with phpBB, is (and I'm not
completely sure about this) that the pages are set to "nocache" so 
everything is reloaded upon
every page access. This keeps the load on the server consistently high 
throughout the day.

~Rolan

Jeff Siegel wrote:

 >Thanks for pointing this out. I remember that article.
 >I'm looking for a "brain-dead" solution, i.e., one that can be
 >implemented in minutes.
 >
 >Jeff


David Mintz wrote:

 > Jeremy Zawodny has some interesting ideas about using MySQL
 > for logging: http://www.linux-mag.com/2002-10/lamp_01.html
 >
 >
 > On Thu, 3 Jun 2004, Jeff Siegel wrote:
 >
 >
 >>The web stats provided by my client's ISP (shared hosting) leaves a lot
 >>to be desired (seems that some things are not being recorded in the
 >>stats log). Just wondering if there is a PHP/MySQL-based solution that
 >>will allow us to get some real stats.
 >
 >
 >
 > ---
 > David Mintz
 > http://davidmintz.org/
 >
 >         "Anybody else got a problem with Webistics?" -- Sopranos 24:17
 > _______________________________________________
 > talk mailing list
 > talk at lists.nyphp.org
 > http://lists.nyphp.org/mailman/listinfo/talk
 >



More information about the talk mailing list