- Newest
- Most votes
- Most comments
Good question and I think that you already alluded to the answer.
Generally speaking, load balancing at low scale does not yield huge performance benefits. The comparison you are making here is appropriate because the larger of the two specs you are comparing is simply double: 2 vCPUs and twice the memory. You would think that performance under load would be similar between the two setups because you have double the CPUs and double the memory, but that all depends on if your application is configured to take full advantage of the CPUs and memory avaiable. In the case of CPUs that usually translates into increasing the number of worker processes. Same thing for memory, espcially if each worker uses dedicated memory. For memory it might require you to configure memory allocation config in your app.
Performance is only half the story, though. As you pointed out redundancy is a big plus of the load-balanced solution. I would argue that for any business-critical workload redundancy is more important that performance/efficiency.
To boil it down to a simple answer: You might be able to configure a larger server to be more efficient than two smaller ones, but you will sacrifice redundancy in the process. What I've always done is tuned my application for a relatively small footprint, made it stateless (*), and deployed it to multiple instances behind a load balancer, even for smaller deployments. This also has the added benefit of allowing you to develop the solution on a small, inexpensive instance and then deploy on the same instances (just more of them).
I hope this helps!
- statelessness refers to a feature of the design where no requests require prior state on the server to succeed (like sessions or cached data).
Relevant content
- asked 2 years ago
- asked 3 years ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated a year ago
You can have similar setup on amazon ec2 as well and host different sites on different servers. If you put your server behind load balancers then you need to make sure the data is synced across all servers behind the load balancer.