Can a Magento Store Handle Five Orders Per Second? You Bet!

fast_shopping Last week one of our Magento hosting clients was featured on the very popular Jill’s Steals and Deals segment on the Today Show on NBC. Being featured on this list results in tens of thousands of visitors going to your website at the same time, and results in thousands of orders within a very short amount of time.

This might seem like a bad idea for a Magento ecommerce website, which “out of the box” does not scale well under heavy traffic such as this…

Luckily we have some experience in this area, and were able to set up their site for success!

Our recipe for success

It is critical that proper preparations are made for an event of this magnitude to work without crashing. We’ve seen other merchants on the show resort to a static order form, offloading the ordering to PayPal directly, and other not so optimal solutions.

For our client, we wanted to keep everything in Magento for a cohesive experience and easy management of the thousands of products to be sold.

Having done events such as these in the past, we had a plan to make this all work:

1. Landing page has to be 100% on a Content Delivery Network (CDN), including all image, JavaScript, and CSS file calls.

This is crucial to survive the initial onslaught of visitors. We set up a splash page that resided 100% on the CDN, so no resources are used on the main website until the customer either adds an item to the cart, or travels to the website through a link.

2. CDN used extensively throughout the website

On the website itself, integrating the CDN for image, JS, and CSS calls is also important. This offloads a bulk of the traffic when the site and cart are being hit by a large number of visitors. We made sure the CDN was set up properly in Magento.

3. A Full Page Cache in Magento is a must

Making use of a Full Page Cache (FPC) in Magento is critical. We helped the client integrate Extendware’s FPC plugin into their store. The FPC module essentially turns much of the Magento site into static files, reducing the CPU overhead of php processing and MySQL queries per page load.

Before the large event, we made sure the cache was “warm”, meaning the catalog pages were all cached beforehand. You don’t want uncached pages when large traffic is expected.

4. Separate MySQL database server

The client is normally on one managed dedicated server. In the past, we’ve seen the MySQL database and PHP fight for CPU resources under heavy traffic. For this event, we added a second server just for the MySQL database. The database server was connected to the main server via a Gigabit private network connection.

We considered setting up two servers for the webserver components, and using either a round-robin DNS balancing set up, or a dedicated nginx load balancer server. However, this adds cost and complexity, and we felt was not needed due to our other preparations.

5. Optimize MySQL, PHP, Apache webserver, operating system

There are many areas that can be optimized, including:

  • MySQL – Query cache settings, InnoDB memory size, timeouts, thread settings, etc…
  • PHP – Memory settings, zlib compression, OpCode Cache enabled and optimized, timeout values
  • Apache – KeepAlives tuned, Max Children, Requests per Child, compression
  • Operating System – Access times disabled, increase maximum open files, increase max user processes

The big day arrives

When the segment aired and the NBC website updated with the deals and links, traffic spiked to say the least. We saw thousands of visitors hit the CDN splash page, and quickly thereafter products being added to carts, website traffic skyrocketing, and a flurry of activity on both servers.

The first few minutes were a bit tense, as things became a bit slow on the site. The MySQL server was handling 2,000 to 3,000 queries per second, and wasn’t under too much stress.

The primary server was seeing a very high CPU usage rate, as PHP was consuming a lot of resources processing carts and the checkout page. We saw Apache children max out at about 1,300 simultaneous processes, and the load on the server initially spiked to over 100. We tweaked a few settings, and got things quickly under control.

I/O usage was low on the main server, as well as on the MySQL server.

At the peak purchasing time, we saw a rate of 5 orders per second in Magento. No issues were encountered, and the orders started flying in. After those first few minutes, everything remained stable as tens of thousands of visitors checked out the deals.

A successful event

The event was a success for our client. We were excited to be a part of it, and help them sell thousands of products in just a few short hours.

Our set up worked well. We could have smoothed out those first few minutes with a load balanced approach of two webservers instead of one, but it wasn’t a big deal in the grand scheme of things. We kept the budget as low as possible while insuring we had the resources and plans in place to achieve success.

If your store is ever preparing for a large event, it’s important that you work closely with your web host to make the proper preparations needed for a successful outcome. Your web host, if experienced, can help you put together the right resources and configuration needed to survive a large influx of visitors all at the same time.

This is why it is so important to have a hosting provider that acts as your partner online, and is knowledgeable and gives you that personal attention that is needed for a big project such as this.

photo credit

Looking for a web host that understands ecommerce and business hosting?
Check us out today!


  1. lampros karalis says:

    Was wondering what were the specs of the server?

Leave a Reply