0

I'm using AWS and currently use ELB (for load balancing and HTTPS termination) in front of two EC2 boxes that are running Gunicorn. For pretty clear reasons (routing certain requests for static files), I'd like to run Nginx in front of those app servers.

My question is, ideally should I have a separate machine just for Nginx? Or is it totally reasonable to just run Nginx on each of those two boxes as well, having the ELB point to the Nginx port for each server?

What are the good and bad?

1 Answers1

0

It depends!

Running both on the same machine is easy to setup, cheaper to run and could suit your needs perfectly (at least to start with).

The benefits of having separate app servers are ... The ability to customise each server independently and being able to scale each independently. If you get lots of traffic or have a need to scale one and not the other this could be quite a useful benefit (and may come with some cost savings in the long term).

Starting off with one app server is common, then splitting it out later when things get more complex is fine. If you have the time and money you may opt to split it out from the beginning but unless you know that you will need to I wouldn't stress over it.

Drew Khoury
  • 4,637
  • 8
  • 27
  • 28
  • Hi Drew, thanks for the answer! Question: would there be performance benefits to running them on separate machines? In other words, will running Nginx on the same machine as Gunicorn slow overall response time due to resources or anything like that? Thanks again! – Jack Chou May 15 '13 at 17:21
  • It's hard to say as it depends on how you've set your machine up. Likely it won't be noticeable until you push the limits of the machine, even then it may not be an issue with auto scaling. – Drew Khoury May 16 '13 at 05:31
  • The benefits would be that each service gets to utilise the entire machine, and they're not fighting for resources on the same machine. Response times should not be 'slower' or 'faster' in either model if you setup auto-scaling with Amazon. The main benefit you get from keeping them on separate machines is that you can scale one without the other. – Drew Khoury May 17 '13 at 02:39