The workflow involved in scaling down WSO2 Private PaaS is illustrated in the diagram below:
The workflow involved in scaling down WSO2 Private PaaS is as follows:
- For the scale-down workflow based on the value of load average, the cartridge instance sends the health statistics and Load Balancer (LB) sends the count of the requests in-flight using the thrift protocol to Complex Event Processor (CEP).
- The CEP will aggregate the health statistics continuously and will publish the summarized health statistics to Message broker (MB).
- Auto-scaler (AS), which will be subscribed to the Summarized Health Stats topic on MB will obtain the values and using the Drools engine, and it will check the auto-scaling and deployment policies for the functionality required based on the count and the threshold values defined.
- When it is required to scale down, AS will publish a graceful shutdown event to the Instance Notifier topic on MB and the Cartridge instance, which will be subscribed to MB will obtain it.
- Thereafter the Cartridge instance will publish a start maintenance mode event to the Instance Status topic on MB.
- The Cloud Controller (CC), which will be subscribed to MB, will receive the event.
- Next CC will publish an member maintenance mode event to the Topology topic to the MB which will be received by the LB, which is subscribed to the MB.
- Then the LB will update the member list.
- Next the Cartridge instance will send a Ready to graceful shutdown event to MB, so that the CC again will receive it.
- Finally the CC will send the information about terminating the instance to the IaaS which will be sent to the Cartridge instance by the IaaS.
Scale-down workflow will be the same as the above for all scale-down workflows based on the value of load average, in-flight requests and memory consumption.