View Full Version : Creating tracking script for high traffic site

01-26-2007, 10:59 PM
I've created a script that is going to function as a toplist for referers, and are experiencing that it might not count correctly.

the site has about 250k unique visitors per day. and what i would like to know is what am i doing wrong.

It is going to track based on which domains sends visitors.
the database table(mysql) has a date, domain_id, hits_in, hits_out.
so when a visitors comes to the site, the script grabs the refferer, and grab only the domain from that string. then it checks in session variable if the user has been counted. if not, it checks to see if the date with that domain is in the database allready, if yes, update hits_in = hits_in+1, if not Insert domain with date, domain_id and hits_in = 1.

What I'm wondering about is, that theese updates are not updating correctly if there are sseveral queries beeing made per second, if tis can cause it to not catch all the hits. anyone know anything about this? I wonder if i just need to have inserts, and have a crontab or something do update the toplist afterwards.

01-27-2007, 12:11 AM
Try checking the amount of connections to mysql your host allows at any one time.