Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Feb 2012
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    High traffic website: Log & Hitcounter

    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 values from/to 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?

  • #2
    Regular Coder
    Join Date
    Dec 2010
    Location
    Kent, UK
    Posts
    573
    Thanks
    23
    Thanked 10 Times in 10 Posts
    there is a site that can do this for you, its really good and ive used it before, its called statcounter, as far as i remember its free, plus its invisable

    here is the link:

    http://statcounter.com/

    Dan
    http://360-tactics.co.uk/forum/index.php

    Crime-Wave

    please post your code wrapped in tags
    please post your PHP wrapped in tags

  • #3
    New to the CF scene
    Join Date
    Feb 2012
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I'd like to keep my site running on it's own without need of any "external" services.

    There must be some other solution.

    But thanks anyways

  • #4
    New Coder
    Join Date
    Sep 2011
    Posts
    80
    Thanks
    0
    Thanked 13 Times in 12 Posts
    To reduce the chance of file corruption you could continue with the file idea, but every hour use a cron job to parse all the data from the file to your mysql database, then wipe the file clean. This way the chance of file corruption is lower and your database only takes a performance hit every hour for a few seconds.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •