Nginx load balancing scenario with 2 locations

June 16, 2014 1.5k views
We're planning to create an environment with load balancer(s) and app servers (running php apps). We have servers currently on Amsterdam and Helsinki. So my question is that is it ok to create load balancer which transfers traffic to both Amsterdam and Helsinki (on least connections rule) or should the all servers exists on same location? Or could some geolocation module on Nginx be advisable? Also if these app servers are using MongoDb and/or MariaDb, where should db server(s) go?
2 Answers
You could, but keep in mind that if you are using the proxy_pass function of nginx that all traffic will pass through your load balancer and if your load balancer is in Amsterdam traffic that gets passed to Helsinki it will be going from the client -> Amsterdam (LB) -> Helsinki, which may cause some delays.
Thanks, I would of course prefer to have everything @ Digital Ocean Ams2, but our biggest clients are operating in Finland. Though the pipeline is quite ok from Finland to Amsterdam, so I might consider still having everything in one place (AMS). Then I probably could utilize the private network between servers (e.g. app server and db server)
Have another answer? Share your knowledge.