Creating a load scheduler using Apache HTTP server
Changing our one machine deployment architecture into multi machines to make it ready for horizontal scaling.
Initially we had an architecture where everything was deployed in one machine , Apache HTTP server and our application server and db layer as well .
Apache HTTP server was used in two capacities. To serve static content and as a reverse proxy to our application server which is serving our api traffic.
However this architecture have draw backs, mainly we do not need so many apache http servers for serving static content , as majority of the heavy weight items are served through CDN. Also if we need to do horizontal scaling of nodes to support traffic , we will have to init another Apache HTTP server as well.
This is monolithic application deployed in multiple nodes with routing done through DNS .
To fix the issue ,we changed architecture into n-tier deployment. We have added one more responsibility to Apache HTTP server , apart from being reverse proxy and static server, to load balance the traffic between our API server nodes. This will help us debug production issues like bring a node down and cut traffic to it and analyse issues or do upgrade one by one and bring them back up. Also it will help us to do scaling by starting up new nodes and linking load balancer to it.
With the help of balancer-manager UI , we can do all these through UI and do not need to log into the particular machine. Also balancer manger can be protected through ACL as well.
131 <Location /balancer-manager>
132 SetHandler balancer-manager
133 Require all granted
134 </Location>
Above snippet into Apache config will help us enable balancer manager , and you can add ACL controls if you wish so.