Along with vertical scaling, MilesWeb’s cloud environment also provides you access to automatic horizontal scaling. Horizontal scaling is increasing or decreasing the number of web or application server nodes in your cloud environment. When you implement horizontal scaling, all the newly added nodes are located at different hardware servers in order to ensure increased reliability, stability and high-availability.
Automatic horizontal scaling can be executed on the basis of triggers that can be tuned, these triggers will monitor the changes in the application’s load; any increase or decrease in the number of nodes as a result of the application’s load is also monitored.
How to set triggers for automatic horizontal scaling?
Horizontal scaling helps you to enable the automatic changing of the web or application server nodes in accordance with the resources consumed by your application. You can specify and set the minimum and maximum allowed number of nodes and you can also define the conditions for the addition and removal of the nodes through the tunable triggers.
You have 5 types of monitoring tunable triggers available based on the type of the resources, they are mentioned below:
- Memory (RAM)
- Disk I/O
- Disk IOPS
All you need to do is set the percentage of the resource consumption limit or maybe a definite level of Mbps use for the network trigger. You will also have to define the time period when the load should stay under or above your specified limit. Once the trigger is enabled, the system immediately starts monitoring the amount of resources consumed by your application.
When the resource consumption level exceeds the limit that you had defined, a trigger is invoked. Subsequently, this trigger will be implemented if the amount of resource consumption does not exceed the specified limit for a definite time period. In this situation, the number of server nodes will be increased or decreased.
Important points to consider:
- Every new node has similar cloudlet limit as the already existing one.
- NGINX-balancer server is automatically added to the cloud environment with a default minimum cloudlet limit when the number of nodes becomes more than one. When the nodes are removed until just one is left, the balancer will be present in the environment containing all the configurations.
- The first (master) node of the layer can also be used as a storage server for transmitting and sharing data within the whole layer.
Follow the steps mentioned below for configuring a trigger for automatic horizontal scaling:
- Click on the ‘Settings’ option in order to select the desired environment.
- Within the open tab, go to the option Monitoring > Auto Horizontal Scaling.
- Select one of the tabs present at the top pane along with the resource type that has to be monitored.
- Your next step is to turn the switcher position to ‘On’ so that you can tune the Add / Remove node conditions. The conditions will become active only when they are enabled and condition parameters are applied.
- On the right hand side, you will see a graph that will display the statistics about the chosen resource consumption. It displays information about the last week’s performance of your application. In this section you can also enable or disable the statics with the ‘Auto refresh’ option.
- If you hover the curser to any particular point on the graph, you will be able to check the exact amount of resource consumption for that moment. This information is useful for setting appropriate conditions for the triggers.
- Every trigger has two options : Add and remove nodes. Your preferred option can be enabled through selecting the check boxes present before the title.
When turned on, every option with the following options:
When loading is more (less) : Than the upper or lower limit will be invoked in percentage or Mbps for network. You can also set the desired magnitude with the help of the sliders present on the right hand side.
For at least : The amount of time in minutes for which a trigger should remain invoked before any changes are made in the nodes count. It can be configured upto 1 hour with a step of 5 minutes.
Scale up (down) to : The maximum or minimum number of application server nodes that can be configured within the application server layer with horizontal scaling.
Scale by : The number of nodes that are yet to be added or removed at the time of trigger’s execution.
- Additionally MilesWeb’s cloud hosting environment provides you with the option of receiving email notifications on the horizontal scaling events. This option is enabled when you activate any of the triggers and you can also disable this option by corresponding to the ‘Send Email Notifications’ switcher. If you enable the email notification option, you will receive an email when any of your triggers are executed.
- Your last step is to press the ‘Apply’ button for saving your triggers configuration, if you are still planning; you can also undo the changes by clicking on ‘Undo changes’.
This completes the process of horizontal scaling. You have complete control over setting the desired configurations for the triggers in order to provide your application with the appropriate number of resources. You can also track the execution of your triggers easily in order to maintain efficient app performance.