Page 1 of 1

High traffic website: Log & Hitcounter

Posted: Thu Feb 23, 2012 7:52 am
by calstap
Hey.

I have a quite high traffic website, around 200 users constantly browsing the site and up to 200k pageviews per day.

I'd like make full log of the page visists and have a hitcounter for some pages.

I made a simple php script that reads/writes hit value from files. The file got constantly corrupted or something similar and the counter started from 0 again.

I'm still quite beginner with php.
What is the best way to make a hit counter for such a high traffic page?
And how about the logs?

Re: High traffic website: Log & Hitcounter

Posted: Thu Feb 23, 2012 10:15 am
by theserve
I would suggest using a database (mysql) to track the hits. This would get rid of the corruption problem.

Re: High traffic website: Log & Hitcounter

Posted: Thu Feb 23, 2012 12:15 pm
by calstap
MySQL server is already under heavy usage and I try to keep it at minimum. Site is hosted on shared server with some mysql limits and it's already getting average of 500 queries per second :?

I'd rather keep it file based, but is there any chance to do it that way?

Re: High traffic website: Log & Hitcounter

Posted: Thu Feb 23, 2012 12:17 pm
by Celauran
Do you not have access to your server's access logs?

Re: High traffic website: Log & Hitcounter

Posted: Thu Feb 23, 2012 12:49 pm
by calstap
I can download them manually, not "automatically" so it doesn't work either