Recommendations (and Differences) between different Ruby on Rails Production Web Servers

后端 未结 4 673
情深已故
情深已故 2021-01-31 05:44

Very soon I plan on deploying my first Ruby on Rails application to a production environment and I\'ve even picked a webhost with all the managed server and Capistrano goodness

4条回答
  •  不思量自难忘°
    2021-01-31 06:31

    Mongrel and Thin are single ruby process servers that you would run multiple of as a cluster behind some type of proxy (like Apache or Nginx). The proxy would manage which instance of Mongrel or Thin services the requests.

    Passenger creates an interface between Apache or Nginx that creates an application spawning process and then forks out processes to server up incoming requests as they come in. There are a lot of configuration options for how long those processes live, how many there can be, and how many requests they will serve before they die. This is by far the most common way to scale up and handle a high traffic application, but it is not without drawbacks. This can only be done on a *nix operating system (linux, mac os x, etc). Also, these processes spin up on demand, so if no one accesses your site for a while, they processes die and the next request has the delay of it starting back up again. With Mongrel and Thin, the process is always running. Sometimes though, your processes being new and fresh can be a good thing for memory usage etc.

    If it is going to be a relatively low traffic site, Mongrel or Thin provides a simple, easy to manage way to deploy the application. For higher traffic sites where you need the smart queuing and process management of something like Passenger, it is a very good solution.

    As for fastcgi, you probably want to use that as a last option.

提交回复
热议问题