Things Are Getting Better
Well, our work is being done, and things are starting to improve. Over the weekend some of our optimizations were implemented in the live site, with more to come. As some of you may have noticed, our site sometimes slowed down in previous weeks, particularly when there has been periods of heavy traffic. For those that just tuned into this saga, it took a while for us to nail down exactly what was causing the problem, which primarily has been in the interactions with the database. To get more specific, the mechanisms that track the ads on our site needed to be optimized, as they were causing slow downs. I won’t get into too much detail, but it had to do with the database checking IP addresses and such to determine whether ad viewers are first-timers or not.
In the process, we were able to nail down a few other measures that we can take to improve performance over the long term, and to ensure that we will not be presented with this problem. Make no mistake about it, the primary weakness in the site has been my programming limitations, but considering that I built the site myself, it could have been much worse. By the beginning of May we hope to have the following changes implemented:
Installation of a custom database abstraction layer - Since I am not really an expert programmer, I have a colleague that is working to build a custom database abstraction layer. This will optimize the interactions with the database to ensure that things are working properly, and efficiently.
Database Optimizations - While the database schema does not require a major overhaul, there are some instances (particularly with regard to the ad tracking mechanism) where some indexes and changes in the way that the database caches information will help to speed things up.
Installation of a PHP Accelerator - I posted a while ago about how we had installed the Zend Optimizer to speed some things up, we are going to also install an accelerator to cache compiled PHP code to also improve performance. This one is a standard among larger PHP sites, and we are doing this to ensure great performance in the future.
Upgrade to PHP 5 - Part of the reason that our optmizations are taking as long as they are is that we are going to upgrade to PHP 5, and are utilizing the new features of PHP 5 in our upgrades. The database abstraction class, for example, is being built using the new features, so we need to complete it and test it before going live.
As of today, we have made some smaller changes and improvements the make the site perform quickly until we finish the major overhaul. The site should be loading very quickly, and there should not be slow downs during traffic spikes. At the end of this month, the site will be even faster (much faster) loading, and will not experience performance drains until we hit the limits of our hardware. Of course, there will be other issues that arise in the meantime, so I will post them here.
Also, to anyone that experienced some problems with viewing our site for a couple of hours on Saturday morning, I apologize. We were running some tests to verify some of our short-term fixes, which caused some users to experience some problems for a limited amount of time.
This post is filed under Developers' Corner and has the following keyword tags: database, mysql, performance.