Reputation: 33
How to distribute the load equally between two web servers in different regions? one in east and another in central.. east server gets exhausted (60% cpu & 100% memory, and swapping heavily), while central server is 100% idle.
Per our DR practices, we need to have servers in two different regions. How do we spread the load equally ? Google uses Geo routing by default, which isn't good for us. Thanks!
Upvotes: 1
Views: 3183
Reputation: 9711
HTTP Load Balancing isn't a strict Geographical routing. If the system understands that one region is overloaded it will overflow traffic to the next region.
I recommend doing a load test and then tuning the backend service balancing settings (balancingMode, capacityScalar, maxRatePerInstance, maxUtilization etc) so that the system knows it is overloading the east server and sends some traffic to your central server.
As a worked example, lets say at the moment 100 RPS of inbound traffic and you have configured balancingMode=UTILIZATION maxUtilization=0.8 (defaults). Because your instance is only 60% cpu, it hasn't reached the max utilization, so they system is sending it all 100RPS of traffic.
Now you do a load test, and discover the server can handle 80RPS of traffic before running out of memory and that CPU isn't a reliable indicator for your memory-intensive application. So you change to balancingMode=RATE, maxRatePerinstance=80. The system then sends up to 80RPS to the east server and 20 to central, and both servers can run adequately.
Upvotes: 2