I have a statcounter website, premiumwebstats.com. I am suing a mysql database but it has slowed down when traffic has reached several million hits a day.
The service monitors not just page counts but also, browser, operating system, month, week and so on. A lot of data.
I am looking to optimize the program so it still runs under load.
First solution is to use text log files for each user instead of mysql. The information in the text files will be counted up with echo "into" [login to view URL] instead of using an update on the mysql database.
And the counting would use the size of the file. I would need a program to transfer the text log file data to mysql and then erase the text log files periodically.
The program would run as [login to view URL] joe, where joe is the user name in question
The programs, including the update program, should be written in php.
This can be done. Though I might recommend optimizing your database and SQL queries before working with flat files. I can do some tests on your server for both solutions to determine which would be more optimal.