Auto-Scalable Magento Cluster for Hosting E-Commerce Projects

Magento is one of the best eCommerce CMS systems available today. Based on numerous IT-technologies, it has flexible modular architecture and an agile ecosystem that can be continually adapted, customized and extended for an e-commerce website, benefiting from a large variety of embedded features like data catalog management, marketing tools, analytics, SEO engine optimization, reporting, etc. Choosing the right platform is the only first step.

The other, equally important, side of the coin is how to ensure the eCommerce system is constantly available for lots of concurrent users. The answer is in proper system architecture and in the ability to be scalable both vertically and horizontally.

Thus, to enable you to launch such a solution with minimal effort, the Jelastic team has developed a dedicated auto-scalable clustered Magento package.

Being deployed in a single-click manner, the Magento Cluster runs a complex container-based failover topology.

Below you’ll find some details on each cluster component’s functions, preconfigured auto-scaling settings, and a simple step-by-step Magento user guide describing how to get your own highly-available clustered Magento CMS up and running within the Cloud in several minutes.



Magento Cluster Topology

This auto-scalable Magento Cluster solution has the default structure as shown in the scheme below.

In order to unify and simplify the provisioning of application components, the following Docker images are utilized:

Varnish - load balancer to distribute incoming traffic within a cluster and to cache all static content running as an HTTPS proxy; automatically scaled based on the amount of incoming traffic

NGINX PHP - application servers to handle Magento engine itself; automatically scaled based on the amount of incoming traffic

Storage – node to keep and share static content between application server instances via NFS

Redis Session Storage - storage node to retain user session parameters so that in case one application server node fails, the second one can retrieve the required data and continue serving the clients without any notable interruption

Redis Cache – node to store Magento cache that helps to improve application response time due to faster page loading when processing similar subsequent requests

MySQL DB Cluster – MySQL database servers with asynchronous master-slave replication between them to achieve high availability, improve data protection, and alleviate system failures.

Herewith, each container within a cluster receives the default vertical scaling limit up to 8 cloudlets (equal to 1 GB of RAM and 3.2 GHz of CPU) and a set of load alerts (to notify you when the resource consumption is close to the limit).

Also, it’s worth noting that when you scale either Load Balancer or Application Server layer, the appropriate configurations are automatically adjusted to include the data on all application server nodes the load should be distributed across. In addition, the application servers layer is automatically scaled by the system based on the amount of incoming traffic in order to handle the changeable load. Further, we will cover how such complex topology can be deployed in Jelastic.

Magento Cluster Installation

Sign in to your Jelastic PaaS dashboard and perform the next simple steps.

1. Open the Marketplace frame, search for the Auto-Scalable Magento Cluster package and press Install.

2. In the installation popup window, type Environment name and optional Display Name (environment alias), select the preferable region (if several are available) and click Install.

3. The environment installation and cluster configuration will take a few minutes until you see a popup window displaying your direct link to the Magento Admin panel with credentials to access it via a web browser.

4. Press Open in a browser to reach a landing page of the pre-configured Magento Theme LUMA, that allows using your Magento eCommerce system right after installation.

5. From the same popup window, you can access an admin panel of the eCommerce system. Here you can find a big variety of store management tools, categorized within separate tabs according to the provisioned options – e.g. Marketing, Sales, Catalog, Customers, Stores, etc. To start with, you can build a catalog for your online store as the very base of any e-commerce service. For that, compose the required catalog structure and fill it in with the proposed merch items.

6. Let’s take a look at the topology you got after installation. As you can see it is pretty complex. Also, it can be tuned with respect to scaling needs to ensure high availability, especially during different commercial events e.g. “Black Friday”.

Magento Application Server Auto-Scaling Settings

As it was mentioned above, the number of application servers in Magento Cluster is adjusted dynamically based on the received load by means of Automatic Horizontal Scaling. By default, the cluster size change is defined with the following conditions:

+1 node if CPU usage is more than 70% for at least 1 minute

-1 node if CPU usage is less than 20% for at least 10 minutes

You can adjust or create new triggers, applying them to all of the stacks in your environment. To do that, click on environment Settings button, then open Auto Horizontal Scaling and follow the guide.

For Magento Auto-Scalable Cluster the appropriate modifications are automatically applied to add/remove application server nodes. And you will receive the corresponding email message on each scaling operation. Each new application server instance is automatically added to the load balancer configurations, and nodes in the LB layer are restarted to apply the updated settings.

The Varnish instance can be scaled manually based on the alert notifications from the platform in case of necessity. The default alert settings can be reviewed and changed in the Settings > Monitoring > Load Alerts section.

Normally for Magento eCommerce systems in production, the External IP address is used for the cluster entry point (Varnish in our case) for more secure connection. It should be bind to a custom domain and registered in DNS as an A records. If Varnish is scaled out, a new instance must be bind to the same custom domain and registered in DNS as the A record with a different public IP.

This clustered solution can help you build an eCommerce system from scratch or move existing Magento project to the scalable cloud. There is a special package that imports data from other Magento platforms to ease the process of migration.

Get rid of any doubts and experience the easiness and flexibility while running your own Auto-Scalable Magento eCommerce system pre-configured by Jelastic PaaS.

Interested in building Magento managed hosting business? Automated installation, scaling and updates simplify the management and support of customers requiring little to no involvement. Start offering this cluster to your users with minimal investment of time and efforts.

Related Articles