Why thin behind nginx?
Asked Answered
O

1

5

Deploying my first web app. I have been using thin, it's simple and easy. All I need is a config file.

But a lot of people use nginx and place a couple thin instance behind that. Why? Why not just use thin alone? And why use nginx rather than placing 3 thin instances behind a single thin instance? Thanks

Outfield answered 18/3, 2013 at 4:7 Comment(0)
P
7

Scalability is the main reason. While Thin can do SSL, serve static files, and handle large responses to slow clients, Nginx is better at all of them for any given CPU and memory footprint. Even better, Nginx can do all that transparently so that the app doesn't have implement anything to benefit. It's also a decent load balancer.

Once your app scales beyond one machine, you will need something like Nginx anyway, and there is no harm in implementing it from the start. Even if your app doesn't need to scale, there are other reasons for using Nginx --- especially if you're running more than one web app on the same machine, or if the app is modular.

Pulsatory answered 18/3, 2013 at 13:41 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.