Close

April 9, 2013

Magento Enterprise To the Cloud

The Magento ecommerce system is a very complicated architecture, fraught with hardware and software tuning, caching systems, and database tuning. On a dedicated server, this can be a challenge to manage on a day to day basis. Moving it to the cloud presents a whole set of factors that will need to be considered.

Magento is a very hardware intensive system that requires extremely fast disk speeds. This is why most Magento hosting providers tout SAN and/or 15k RPM disks on all of their hosting accounts. If you try and run it on an ordinary, shared hosting account, you will be in for a very rude awaking.

Here are some of the items that you need to consider for your move:

Know Thy Traffic

When you move to the cloud, you are using the resources as a utility, similar to a water bill. The more you use; the more it will cost. All cloud servers come in a variety of sizes that charge you increasingly more for larger sizes. You need to perform a detailed analysis of your current traffic patterns to determine what size server you will need. While the cloud allows you to upscale as necessary, your budget for the year will definitely be broken at that point.

Licensing Issues

The licensing model for the enterprise edition is very restrictive as well. As of this publishing, you can only utilize one instance of Magento per website. So, you cannot, technically, load balance the webserver using multiple instances without paying for multiple licenses.

Testing, Testing, and More Testing

Granted, setting up your instance in the cloud is not all that difficult, but if you are adding new caching mechanisms (e.g., Varnish/Memcache), make sure you thoroughly test them. Adding documentation for your store managers will also be important since your changes to pictures or products may not be made available until the cache system is flushed.

Do not get fooled by the seemingly immense speed of your new system. A cloud system without any users does NOT behave the same as when it is under a high user volume. Load simulation software would help with this, but be aware, you are paying for the cloud when you are testing it.

Mail Settings

Make sure your mail server settings are setup on the cloud site correctly. Add the IP to your SPF record in your DNS to let the rest of the internet know that your cloud server is allowed to send mail.

Post Launch

Carefully monitor your resources after launch for a few weeks. If you have both a web and database server, make sure that both are being utilized correctly. If they are being under-utilized, make sure you restart your server at a lower utilization priority. On some of our higher load sites, we noticed that the webserver needs more horsepower and that the database needs significantly less.

Also, once you have your servers locked down, check and see if your cloud provider allows you to “lock in” your rate in a flat fee so that your utility rates are significantly cheaper. For instance, Amazon EC2 lets you purchase a “Reserved Instance” for a year saving you a tremendous amount on your server costs (See: http://aws.amazon.com/ec2/reserved-instances/ ).

Make sure you monitor your adword campaigns and any other reports closely. We have notice on occasion that some of the traffic “stopped” working in the new cloud setup. The some of the campaign links had to be re-saved in their respective tools before the analytics reports were able to report them again. We ended up installing Piwik to compare our stats with Google Analytics.

Post Launch Traffic

Since you are now paying for your site as a utility, you will want to make sure that no one is causing you to spend money needlessly. It was amazing the amount of ridiculous bots that we found regularly crawling our sites for no reason at all. Most were rude and ignored our robots.txt file, so we ended up forcing them to a 403 page via an HTACCESS file:

 

RewriteCond %{HTTP_USER_AGENT} (AcoonBot|MJ12bot|Yandex|Baiduspider|RU_Bot|FatBot|Mail\.RU_Bot|AhrefsBot|AskTbORJ|TwengaBot\-2\.0) [NC]
 
RewriteRule .* - [R=403,L]

In addition, you may consider a third party service such as CloudFlare and their Business Plan. They provide a full-scale application firewall for your cart and are able to quickly detect/block nefarious users on your site.

Backup

Always have a contingency plan for your cloud launch. If something goes drastically wrong with your launch, always make sure that your previous hosting is available in case you need to fall back to it.

As always, make sure you follow through the cloud server setup with a robust server security hardening procedure, just as with any server setup (i.e., firewall, close down all unnecessary ports, strong passwords etc).

In conclusion, cloud computing offers a brand new era of fault tolerant utility computing. While cost is certainly a factor for organizations moving all into the cloud, the resilient nature and ability to scale to larger sizes quickly is a very big draw for larger trafficked ecommerce sites. I hope that Magento continues to push with tighter controlled functionality with cloud providers and not just rely on third-party developers.