Harald Zeitlhofer

Subscribe to Harald Zeitlhofer: eMailAlertsEmail Alerts
Get Harald Zeitlhofer: homepageHomepage mobileMobile rssRSS facebookFacebook twitterTwitter linkedinLinkedIn


Related Topics: Cloud Computing, Application Performance Management (APM), DevOps Journal

Article

Black Friday Business Rescue | @CloudExpo #APM #BigData #Microservices

Black Friday and Cyber Monday are the most important days in the retailer’s year

Last-Minute Black Friday Business Rescue and Cyber Monday Readiness

In order to be ready for the Christmas season, online retailers typically bring their shops into shape right before Black Friday. Together with Cyber Monday this is the most important day in the retailer's year.

Stilnest.com (@Stilnest) is a publishing house for designer jewelry, running their online shop on Magento. While the guys at Stilnest did a good job of preparing their environment, the interest in their products and, therefore, the traffic on their site, was much higher than expected. The shop even went down after one of the YouTube stars released a new video showing off her new jewelry line powered by Stilnest.

In this classical "War Room" situation I worked together with Stilnest to find the root cause(s). Good news is that we worked out a solution and brought the shop online again - just in time for Black Friday. This blog summarizes the technical details on what went wrong in their case. I hope you find this useful and may start checking your own environment - the holiday shopping season is not yet over:

  • Fixed environmental settings: Processes per CPU core
  • Optimized number of database statements per request
  • Speed up database connection
  • Optimized third-party modules (Magento marketplace)

A Quick Overview of Their Environment
The shop runs in AWS. A load balancer distributes the incoming requests to different servers, organized in an auto scaling group. Each server runs one instance of Nginx and three instances of PHP-FPM. Another server running Varnish is used for caching, while the PHP processes connect to a MySQL database, hosted by AWS.

What They Did to Prepare for Black Friday
First thing you want to confirm is that the servers running Nginx and PHP are not overloaded. The general rule for Nginx is one worker process per CPU core. In our setting we are using EC2 instances with four cores and start 1 Nginx worker per instance. The other three cores are reserved for PHP. In PHP there is no limitation on CPU cores; you can run as many child processes as your memory allows. Check the memory consumption of your application and specify the number of child processes accordingly.

Then ensure your auto scaling group in EC2 is configured properly. Several metrics can be perfectly used for this purpose, like CPU and memory consumption. But there are more relevant metrics that you should consider:

  • page load time
  • request rates
  • concurrent users
  • user experience

APM tools like Dynatrace provide these data in a most convenient way to use them in the EC2 auto scaling criteria.

These charts demonstrate the scaled environment under different load conditions:

Web requests over time

Server instances at low load

Click here for the full article

More Stories By Harald Zeitlhofer

Harald Zeitlhofer has 15+ years of experience as an architect and developer of enterprise ERP solutions and web applications with a main focus on efficient and performant business processes, usability and application design. As a Technology Strategist in Dynatrace's Centre of Excellence team he influences the Dynatrace product strategy by working closely with customers and driving their performance management and improvement at the front line. He is a frequent speaker at conferences and meetup groups around the world. Follow him @HZeitlhofer

Comments (0)

Share your thoughts on this story.

Add your comment
You must be signed in to add a comment. Sign-in | Register

In accordance with our Comment Policy, we encourage comments that are on topic, relevant and to-the-point. We will remove comments that include profanity, personal attacks, racial slurs, threats of violence, or other inappropriate material that violates our Terms and Conditions, and will block users who make repeated violations. We ask all readers to expect diversity of opinion and to treat one another with dignity and respect.