In addition to the inbuilt automatic vertical scaling, CirrusGrid PaaS can automatically scale nodes horizontally, changing the number of containers within a layer (nodeGroup) based on incoming load. Herewith, all instances within the same layer are evenly distributed across the available hardware sets (hosts) using the anti-affinity rules. Namely, when a new container is created, it is placed at the host with the least number of instances from the same layer and the lowest load mark, which ensures reliability and high-availability of the hosted projects.
Automatic horizontal scaling is implemented with the help of the tunable triggers, which are custom conditions for nodes addition (scale out) and removal (scale in) based on the load. Every minute Jelastic analyses the average consumption of the resources (for the number of minutes specified within the trigger) to decide if the node count adjustment is required.
Herewith, the statistic is gathered for the whole layer, so if there are three nodes, which are loaded for 20%, 50%, and 20% respectively, the calculated average value is 30%. Also, the scale in and out conditions are independent, i.e. the analyzed period for one is not reset when another one is executed.
Below, we’ll overview how to:
To configure a trigger for the automatic horizontal scaling, follow the steps below.
Note: When a single certified application server (not a custom Docker container) is scaled out on environment without load balancers, the NGINX balancer is added automatically. Herewith, if you require a different one for your application, it should be added manually before the first scaling event.
1. Click the Settings button for the required environment.
2. In the opened tab, navigate to the Monitoring > Auto Horizontal Scaling section, where you can see a list of scaling triggers configured for the current environment (if any).
Use the buttons at the tools panel to manage auto horizontal scaling for the environment:
Click Add to proceed.
3. Select the required environment layer from the drop-down list and choose the resource type to monitor via one of the appropriate tabs (CPU, Memory, Network, Disk I/O, Disk IOPS).
4. The graph to the right shows the statistics on the selected resource consumption. You can choose the required period for displayed data (up to one week) using the appropriate drop-down list. Herewith, if needed, you can enable/disable the statistics’ Auto Refresh function.
Also, you can hover over the graph to see the exact amount of used resources for a particular moment. Use this information to set up proper conditions for your triggers.
5. Each trigger has Add and Remove Nodes conditions, which can be enabled with the corresponding check-boxes right before the title.
Both of them are configured similarly:
When configuring a trigger, we recommend taking into consideration the scaling mode of the layer. For example, you should set lower loading percent in the Add Nodes trigger for the stateful mode, as content cloning requires some time (especially for containers with a lot of data) and you can reach resources limit before a new node is created.
6. You automatically receive an email notification on the configured auto horizontal scaling trigger activity by default; however, if needed, you can disable it with the appropriate Send Email Notifications switcher.
7. At the bottom of the form you have the following buttons:
Select the required option to finish trigger creation (adjustment).
You can view the history of scaling triggers execution for a particular environment.
In the example below, we’ll apply high load for 5 minutes (see the RAM usage statistics in the image below) on the application server with the following triggers configured:
Now, let’s see the automatic horizontal scaling behaviour:
1. Navigate to the Settings > Monitoring > Events History section and choose the Horizontal Scaling option within the Type drop-down list.
Additionally, you can customize the period to display triggers activity for via the appropriate From and To fields.
2. The following details are provided within the list:
Additionally, upon hovering over the particular record, you can additionally check the Loading Value (resource usage on the moment of execution) and Node Count (resulting number of nodes).
The Add and Remove Nodes triggers are independent, so the removal condition (average load less than 20% for at least 10 minutes) is not reset and continued to check even after a new node addition. Such an approach provides a quicker detection of the sufficient average load during the specified interval. It’s recommended to set a significant difference between scaling out and scaling in limits to avoid often topology change.
That’s it! In such a way, you can configure a set of tunable triggers to ensure your application performance and track automatic horizontal scaling activity directly via the dashboard.
In case you have any questions, feel free to appeal for our technical experts' assistance at Stackoverflow.
Powered by BetterDocs
Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.
Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.