I have a site which is getting over 250,000 hits a day and I'm wondering what the least resource-intensive method would be to count hits per day.

I originally had a script that wrote a timestamp, visitor IP and referring url to a text file using fwrite().

My hosting company has since told me that the server was going nuts when the traffic started rising so I had to disable the script.

I'd like a script that updates a single figure and starts a new line every 24 hours if possible, but I'm unsure of the most economical PHP method for this.

I'd like to record it in a text file.

Can anyone offer any wisdom?

Also, would javascript be more efficient?