I run a news website programmed in php with a mysql database. We have two separate servers - one a web server the other is the database server. All of the sites articles are stored in a single table (on the mysql database on the database server). Also in the same table is a field set up as a counter - which counts the number of people that view each article.
The problem with this set up is that whenever a user visits a page, the counter is updated. And while the counter is being updated, mysql freezes for a split second (to update the counter) and does not allowing others access to the table. As the traffic on the site increases, this is causing substantial delays and even mysql time outs.
Here is what I need done:
1. Review the php code for the site (so that you are familiar with the way it works).
2. Figure out a way to store the counter temporarily on the web server (possibly in a global variable) and have it periodically sent to the database server. Please note there may need to be a separate variable created for each article (past and future) since the counter counts the visits to each article.
If this works well, we have many future projects for you