Transforming the AMS Website: A Case of Performance Excellence

Technology
Productivity

Transforming AMS website for optimal performance and user satisfaction, achieving significant improvements in server efficiency and end-user experience.

Introduction

When examining the website of one of our clients, AMS, we encountered a challenge: the site, with its vast content spanning over 2000 pages in two languages, faced downtimes, especially during high traffic periods triggered by our email campaigns. The issue? A significant increase in PHP activity overwhelmed the system whenever a large audience engaged with the site simultaneously. Determined to address this, we have delved deeply into the matter to develop a robust solution to enhance the site's reliability and performance.

The Diagnostic Phase - Stresstests

The first step in our quest was to replicate the AMS website in a test environment, allowing us to conduct stress tests without risking further downtime. Using Loadforge, a tool for simulating user visits, we initially tested the site's capacity with 500 users, leading to downtime. Even more surprising was the site's inability to handle just 50 users, signaling a profound need for optimization.

With the help of New Relic, a monitoring feature provided by our hosting partner DeltaBlue, we identified that web transactions were excessively high, significantly impacting the site's performance. The analysis revealed that PHP transactions and database queries were the primary bottlenecks, with transaction times peaking alarmingly during heavy database interactions.

Implementing Solutions

Our approach to resolving these issues involved several strategic enhancements aimed at reducing server load and improving site performance.

Caching for Enhanced Speed

Caching acts as a mechanism to store and quickly retrieve frequently accessed data, thereby speeding up response times. Despite having the "Blitz Cache" feature available, it was initially inactive.


"Blitz Caching  is a cutting-edge technology designed to significantly improve website performance by intelligently caching content. It identifies and stores frequently accessed data, allowing for faster retrieval and reduced server load times."


Activating it and making necessary adjustments, such as disabling conflicting caching features and automatic page refreshes, significantly improved site efficiency. This allowed the AMS website to accommodate a larger volume of requests seamlessly.

  1. Configuration Assessment: We checked how Blitz Cache was set up to make sure it was working correctly.
  2. Disabling Native Caching: We turned off native caching because it was causing compatibility issues with Blitz Cache. Even in the documentation we can find Craft’s tag doesn’t always play well with Blitz cache invalidation. Since template caching becomes redundant with full page caching, it is best to remove tags from templates Blitz caches, or simply disable template caching from config/general.php.
  3. Disabling Caching Function: Additionally, we disabled refreshCacheAutomaticallyForGlobals, a function that refreshes all cached pages when globals are changed, which is not recommended. Cache will only be renewed for the adjusted pages and related relations. This function, while helpful in some cases, was causing extra work for the server. So, we decided to turn it off to reduce the server's workload.

Entrification on Craft CMS

Craft CMS is historically structured with different sections. There are entries for webpages, categories for content categorization, and globals that store website settings and variables. The manufacturers of Craft CMS are currently rebuilding this setup from scratch. With Craft 5, everything will be consolidated into a section called 'content'. So to address the globals issue, we had to 'entrify' all the globals, categories, and tags, as suggested by Blitz.

The structure of Craft CMS, which underpins the site's content management, was then streamlined. This optimization meant that updates to text or images could be made without the need to refresh the entire site cache, conserving server resources and enhancing the content management process.

Refining Site Navigation

By moving the site's navigation setup to a dedicated plugin, we minimized complex queries and improved integration with the caching solution. This change further reduced the server load, making the website more responsive to user interactions.

Outcomes and Impact

The results of our efforts were unequivocally positive. A subsequent stress test with 1000 users showed no downtime, marking a significant milestone in the site's performance capabilities. Server efficiency improved dramatically, with the ability to handle an average of 32 requests per second without any hiccups (see image below).

Post-deployment analysis using New Relic showcased a 50% decrease in web transactions, with transaction peaks during high traffic periods remaining consistently below pre-optimization levels. Moreover, the improvement in the Apdex score indicated a significantly enhanced ability of the server to manage the website, leading to a superior end-user experience.

Conclusion

The journey to improve the AMS website was one of meticulous analysis, strategic planning, and effective implementation. By addressing the root causes of performance bottlenecks and deploying targeted solutions, we not only overcame the challenge of downtime but also set a new standard for site reliability and user satisfaction. The AMS website is now used to its full potential and ready to serve its audience with much more efficiency.

Thanks to the efforts of team Lunar the end-user experience has been greatly enhanced compared to the previous state.

Yawuar Serna Delgado