MusicGearGeeks.com success story
This brief article highlights the performance optimizations we implemented for one of our customer's Drupal sites - musicgeargeeks.com (note: the site appears to be unavailable now; this article was originally written in 2012).
Initially, the site faced serious performance issues, with page load times reaching up to 30-40 seconds. To address this, we began by profiling the code. Our analysis revealed that more than 90% of the loading time was consumed by HTTP requests to third-party servers. After further investigation, we discovered these requests were directed to Amazon.com, retrieving product information displayed on the site.
Although the Amazon module had its own caching mechanism, the high volume of requests remained puzzling. A deeper dive revealed several underlying issues:
- Duplicate Requests: The site used two separate modules to retrieve product information:
amazon
andamazon_store
. Each module maintained its own cache, but the caches were not integrated, effectively doubling the number of requests. - Unnecessary Requests: Some products had been removed from Amazon, but both modules continued to try and load them during every page session, resulting in redundant requests.
- Inefficient Template Code: The templates responsible for displaying products were suboptimally designed. In cases where a product could not be loaded, the site would attempt 5-10 unsuccessful retries, greatly increasing page load times.
Solutions Implemented
To resolve these issues, we made the following changes:
- Optimized Templates: We rewrote the product display templates to ensure each product was loaded only once per page.
- Consolidated Modules: The code was adjusted to use a single module—
amazon
—eliminating the need for duplicate requests. - Enhanced Caching: We introduced an additional cache layer. This cache stores product data during site operations and marks products as "removed" if they can no longer be loaded from Amazon. Once marked, these products are no longer requested, preventing unnecessary load attempts.
- Caching Systems: We implemented APC and memcached caching systems to further reduce server load.
Results
These optimizations solved the primary issue, reducing page load times from 30-40 seconds to 1-4 seconds. A series of minor adjustments also contributed to the overall performance boost, greatly improving the site's speed and user experience.