为什么落后于nginx? [英] Why thin behind nginx?

查看:61
本文介绍了为什么落后于nginx?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

部署我的第一个Web应用程序.我一直在使用Thin,它很简单容易.我需要的只是一个配置文件.

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

但是很多人使用nginx并在其后放置了几个瘦实例.为什么?为什么不只使用瘦身呢?以及为什么要使用nginx而不是将3个精简实例放在单个精简实例后面? 谢谢

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

推荐答案

可扩展性是主要原因.尽管Thin可以执行SSL,提供静态文件并处理对慢速客户端的大量响应,但对于任何给定的CPU和内存占用量,Nginx都可以更好地解决所有问题.甚至更好的是,Nginx可以透明地完成所有操作,从而使该应用程序没有实现任何可受益的功能.这也是一个不错的负载平衡器.

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.

一旦您的应用扩展到一台机器之外,无论如何您将需要像Nginx这样的东西,并且从一开始就实施它不会有任何危害.即使您的应用程序不需要扩展,使用Nginx的其他原因也有---特别是如果您在同一台机器上运行多个Web应用程序,或者该应用程序是模块化的.

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.

这篇关于为什么落后于nginx?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆