开发者

What is the best software to host a ruby on rails application on production? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.

Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.

Closed 8 years ago.

Improve this question

Is webrick the only good option? I kn开发者_如何学编程ow there is a way of using apache, but is it better than webrick?


Four Choices

There are really four choices, well, plus WEBrick, but that would be an unusual choice for a production server. Approximately in order of increasing complexity...

  • nginx + Mongrel
  • nginx + Passenger
  • Apache + Mongrel
  • Apache + Passenger

(There is Phusion Passenger Standalone, but that's really an nginx + passenger compiled together, so I'm not counting it, although it may be a good option for some people.)

A larger site may then add specialized layer 7 hardware (NetScaler, F5, ...) in front of the servers.


Phusion Passenger... it's much better than WEBrick. Passenger is the de-facto standard for deploying on Apache. It also has options to run on an Nginx environment, or as a standalone server (like WEBrick). See this question about Passenger Standalone.

There are other less commonly used options, notably including Mongrel.

Also, you might be interested in Heroku, which I use. It's a cloud based production server, and has free deployment options for small sites. Heroku takes care of all the server-side for you, which is a real relief if you're not a server admin (I'm not).


Honestly, passenger is really good for Apache, but I would consider an external hosting solution. For small projects, heroku provides free hosting, and for large projects, you can scale as needed with relatively low prices. There are some others out there, but heroku (IMHO) gives you the most flexibility... and its FREE (and reliable)!


Phusion Passenger is the de facto Apache mod, and yes, it's better than WEBRick (which is really only good for tiny sites or testing).


We use heroku and despite it runs with ruby 1.8.7, I never had problems with it


As stated before: Webrick is for development only, do not use that for deploying.

The simplest replacement for Webrick is using mongrel. But that doesn't scale well (in the end). A mongrel is a single thread, so a mongrel-process can only handle one process at a time. If you have a lot of users, you will have to install many mongrel, load-balanced by an apache or nginx in front of it.

Then it depends on your server platform: on any linux flavor (ubuntu/debian/mac os) you could use apache/nginx in front of passenger, mongrel, thin, unicorn, ...

From all these options, passenger has the easiest integration. If you use mongrel/thin/unicorn you will have to specify your own load-balancing between different instances and manage that yourself. Passenger handles that for you.

If you are on Windows passenger can't be used, but mongrel or thin are still viable (not unicorn). On Windows i would recommend using mongrel_service for each mongrel-instace you keep running, behind an apache webserver.

But heroku is the easiest of them all (if you do not have to deploy on a server inside your building).


A good place to see the standard tools used by Rails apps is at https://www.ruby-toolbox.com/. The most popular choices are usually the best but sometimes it's good to check out alternatives for your specific use cases.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜