We’ve talked before on this blog about our endeavors to make Magento run more effectively for high-volume, enterprise sites by leveraging the Amazon EC2 environment. After several successful implementations, here are the top 9 lessons we’re learned.
1. Use c1.medium for CPU. After testing several instances for homepages and carts, it seems that a standard option that gets good value for your money is c1.medium, which can handle approximately 1,500 customers per hour.
2. Use a reverse proxy or light http server for serving static content – such as images, CSS and other media – or a CDN (content delivery network) if your customers are spread out geographically.
3. Cache product catalog views, at least for anonymous users (typically 90% of site visitors). Magento Full Page Cache or reverse proxies (i.e. Varnish) can help with this. If most of your customers are logged in, however, you likely need to develop some custom caching (i.e. Ajax, server side includes, etc.). This will improve site performance for end users dramatically.
4. Scale horizontally by adding servers. This will allow your site to cope with peaks of traffic – an expected occurrence in ecommerce due to busy times (evenings, holidays, large sale events). To ensure you anticipate traffic ebbs and flows as accurately as possible, a fully automated provisioning process of servers that record visitor behavior by the minute is ideal.
5. Share Magento back-end cache between all servers to avoid inconsistencies. A mix of memcached (fast cache) and mysql (slow cache) is the optimal setup, particularly if visitor sessions need to be shared between servers.
6. Plan for disaster. Servers can fail at any time on the cloud, at a higher frequency than on traditional hardware. Reduce the number of SPOFs (single points of failure) and automate recovery procedures. Actively monitor server performance to avoid server failures. If a customer can’t access the site when they want to make a purchase, they may go to a competitor instead.
7. Tune the database to best practices. However, this is surprisingly not a major bottleneck in regard to performance and scaling. You can split read-write traffic, or even scale vertically, with short interruption of service in case databases become an issue.
8. Centralize or proxy-out your communications from a single server. Often integration with back-office systems likes static IP for firewalling.
9. Rely on infrastructure value-added services - such as S3, ELB, EBS, SQS, Monitoring and Rightscale - to reduce your operational cost.


