4 ms·
I realize the diagram is likely heavily over-simplified, but what's the reason for the nginx layer? It doesn't look like you guys are serving assets through tho
by gfodor 14y ago
I realize the diagram is likely heavily over-simplified, but what's the reason for the nginx layer? It doesn't look like you guys are serving assets through those boxes, so it seems like you have an unnecessary extra hop from the ELB to the app servers. My guess is this is either nginx caching, a holdover from the pre-aws architecture or a measure to keep the system decoupled from ELB?
- trustfundbaby 14y ago> I realize the diagram is likely heavily over-simplified, but what's the reason for the nginx layer probably to load balance between unicorn instances in the particular amazon EC2 instance
- tcwc 14y agoI can't speak for Parse, but I've come up with something similar in the past. Nginx/HAproxy as a combo is far more flexible than the ELB alone, you might want to use it for rate limiting, better load balancing algorithms, better logging, tweaking headers, handling errors, or controlling buffer sizes for example.
- pjscott 14y agoOr for preventing DoS attacks from slow client connections. Unicorn is not designed to be exposed to the outside world; it needs a reverse proxy that does request buffering, like nginx (which the Unicorn docs recommend).
- tcwc 14y agoTrue, though the ELB also does some simple buffering of HTTP requests.
- spimmy 14y agoWe use nginx for serving static files and doing some trivial top-level routing. Haproxy is for load-balancing among families of unicorn app servers.