Which one is the best option to use with the Last Rails app? Mongrel, Thin, WEBrick and Passenger

I played and evaluated the other default WEBrick server options for rails, and Thin was the most painless and cleanest that worked very well.

which of these Mongolian, thin, WEBrick and passengers would you recommend and why ...? are there any scalability options (cluster friendly or configurations that can handle any scale) that come with any of these servers .. or if scalability is even a parameter when evaluating them?

+8
ruby-on-rails scalability passenger mongrel thin
source share
3 answers

Deepak has already answered half your question, but let me tell you a little about things. (I am one of the authors of Pusion Passenger.)

  • WEBrick is a gaming web server. No one uses it for anything other than development, because it works poorly and is said to lose memory.
  • You said Ton works well. Have you configured it in reverse proxy configuration yet? Because this is what people do in production scenarios. It is not safe to expose Thin (or Mongrel, or Unicorn) directly to the Internet.
  • You might be interested in reading the Ruby on Rails server options and the Phusion Passenger architecture overview for more detailed explanations.

When it comes to scalability, there isnโ€™t much difference. They are all very similar in production, they are all about the same, and any problems you encounter will most likely be caused by your application or Rails. Well, except for WEBrick, which you really shouldn't use in production. You can see the difference in world tests, but thatโ€™s all. In production, most of the time will be spent in the application, so any slight differences in speed visible in welcome tests will become completely invisible.

There are some subtleties that you need to know about.

  • Phusion Passenger provides a feature called the global queue. It solves a specific problem, explained in detail in the manual . By default, Nginx and Apache proxy requests are cyclically processed, so they suffer from this problem, while Phusion Passenger does not. There are ways around this if you are not using Phusion Passenger, but they require a specific configuration or installation of additional web server modules.
  • The I / O model may or may not be important depending on the nature of your application. Mongrel, Thin, Unicorn, all of them are multiprocessor single-threaded. This is great for traditional web applications that look for material in the local database and do something, but heavily burden applications that make many HTTP API calls or otherwise have to wait a lot from I / O. Why Rails 4 Live Streaming is a big deal explains it in detail.

    Phusion Passenger is also multi-processor single-threaded, but Phusion Passenger Enterprise supports multi-threading. Phusion Passenger Enterprise is an open source commercial version of Phusion Passenger with many features useful for large-scale production environments.

  • In large production environments, some functions become important, for example. a reboot showing nothing wrong with a failed deployment, etc. Mongrel, Thin, Unicorn, Phusion Passenger, all of them to some extent reveal these features, but some require more administrator effort than others. For example, to implement a restart in Mongrel and Thin, you need quite a few steps in deployment scripts. A unicorn does not require so many steps, but still significantly. This is where Phusion Passenger Enterprise shines: it uses all these features and turns them into one configuration option. Turn this option on, and the software will take care of the rest.

So, choose any option that you think is best suited for your scenario.

+9
source share

The easiest way to set up for production is likely to be Apache and mod_rails (passenger). If you want to use the new vehemence, you can give nginx and the passenger a whirlwind.

For mongrel development, it's usually easiest to work. Most Windows IDEs (RadRails, Netbeans) give you the ability to use Webrick or Mongrel for development and allow you to manage servers from the IDE itself.

Update

Four options

There are really four options, as well as WEBrick, but that would be an unusual choice for a production server. Roughly in increasing order of difficulty ...

nginx + Mongrel nginx + passenger Apache + Mongrel Apache + passenger (There is a standalone Phusion Passenger Standalone, but it is really a compiled nginx + passenger, so I do not consider it, although it may be a good option for some people.)

A larger site can then add specialized level 7 equipment (NetScaler, F5, ...) in front of the servers.

+1
source share

Thin is as simple as a gem โ€œthinโ€ for design and production

0
source share

All Articles