Jelastic horizontal scaling lets you to configure automatic changing of the web/application server nodes’ number according the resources consumption of your application. You can set the minimum and maximum allowed amount of nodes, as well as the conditions for their addition or removal, by means of tunable triggers. Herewith, there are five types of monitoring triggers available, which are based on the usage of a particular resource type, namely:
- Memory (RAM)
- Disk I/O
You simply need to state the percentage of the resource consumption limit (or, possibly, a particular level of Mbps usage for Network trigger) and the time period the load should stay under/above it. After enabling, the trigger instantly starts to monitor the amount of resources your application consumes.
When the usage level exceeds the stated limit, a trigger becomes invoked. Subsequently, it will be executed if the amount of consumed resources will stay out of the specified limit for a defined period of time. In this case, the number of server nodes will go up or down.
- each newly added node has the same cloudlet limits as the already existing one
- NGINX-balancer server is added to the environment automatically with the default minimum cloudlet limits once the number of nodes becomes more than one. When the nodes are removed (so that just one is left), the added balancer will remain present in the environment with all configurations
So, to configure a trigger for the automatic horizontal scaling, follow the next steps:
1. Click the Settings button for the desired environment.
2. In the opened tab, navigate to the Monitoring > Auto Horizontal Scaling section.
3. Choose one of the tabs at the top pane with the resource type, that is required to be monitored.
Percentage for both CPU
monitoring triggers’ execution is calculated based on the amount of the allocated cloudlets
(a special Jelastic resource unit, which represents 400 MHz CPU and 128 MiB RAM simultaneously).
Change the Turned switcher position to ON in order to be able to tune the Add/Remove Nodes trigger's conditions.
Note: The trigger becomes active only after it’s enabled with the Turned switcher and conditions parameters are Applied.
4. In the right part of the section, you can see the graph, which shows the statistics on the chosen resource consumption.
It stores and displays information on application’s performance for the last week. You can choose an exact time period you are interested in using the drop-down list above the graph. Also, here you can enable/disable the statistics’ Auto refresh function.
5. Hover over a particular point of the graph to see the exact amount of resourceconsumption for the chosen moment of time. This information can be used for setting proper conditions for triggers’ execution.
6. Each trigger has two options (i.e. Add and Remove Nodes), which can be enabled with the corresponding check-boxes right before the title.
After being turned on, each of them can be configured in a similar way using the following options:
- Whenever loading is more (less) than - the upper (lower) trigger limit in percentage (or Mbps for Network), based on which it will be invoked. The required magnitude can be also stated with the help of the appropriate sliders to the right.
Tip: The 100% value will automatically disable the Add Nodes trigger, while stating 0% will turn off the Remove Nodes one.
7. As an addition, Jelastic gives you the possibility to receive email notifications on horizontal scaling events. This option is enabled by default upon activating any of triggers; nevertheless, you can easily disable it using the corresponding Send Email Notifications switcher.
In case it is enabled, you will receive the appropriate email message every time any of your triggers is executed. It will provide an information on the current consumption level of a particular resource and the number of nodes that were added or removed.
8. Lastly, you need to Apply the changes in order to save your trigger(s) configurations (or, if it’s required, you can Undo Changes with the same-named button and return to settings you’ve used before).