Integration modes
Passenger collaborates with other components. This is why Passenger supports multiple integration modes. Each integration mode is designed for easy collaboration with a different component.
On this page we will explain the differences between the modes, and advise you on how to choose a mode.
Table of contents
- Loading...
The modes explained
During development, you will usually want to use the Standalone mode because it's the most convenient in that context. But in production you may want to think about which integration mode to pick.
The supported integration modes are:
-
Standalone mode
The Standalone mode is what you've experienced in the Quickstart tutorial. You start Passenger through thepassenger start
command. If you are a Ruby user, then in this mode Passenger behaves somewhat like "rails server".In this mode, Passenger doesn't automatically collaborate with other components, hence the name. Because of this, you do not need to setup any other components besides Passenger, which makes the Standalone mode the easiest mode to get started with. We recommend this mode for use during development. That said, this mode is also fit for production.
In the Nginx and Apache integration mode, Passenger takes care of glueing Nginx/Apache together with Passenger. In the Standalone mode, you are expected to do that yourself, e.g. using reverse proxies, init scripts, etc.
-
Nginx integration mode
The Nginx integration mode provides easy integration with Nginx. Passenger operates as an Nginx module. You operate Passenger mostly through Nginx and through Nginx configuration files. So instead of worrying about Passenger and Nginx seperately, you treat the both of them as a whole.This mode is mainly meant for production use, not for development use.
-
Apache integration mode
The Apache integration mode provides easy integration with Apache. Passenger operates as an Apache module. You operate Passenger mostly through Apache and through Apache configuration files. So instead of worrying about Passenger and Apache seperately, you treat the both of them as a whole.This mode is mainly meant for production use, not for development use.
Differences
All modes provide roughly the same feature sets. The main differences lie in…
- …performance. Standalone and Nginx are slightly faster than Apache.
- …usability. Standalone is easier during development, but Nginx and Apache are easier during production.
- …multitenancy. The Nginx and Apache integration modes can host multiple apps at the same time.
- …flexibility and control. If your production cluster has an advanced architecture, or if you need deep control over every aspect of the system, then Standalone is the best choice during production.
Each mode is mostly independent
Each mode is mostly independent from the others. This means that each mode has its own configuration mechanism and its own way to be started/stopped, unless explicitly documented otherwise.
For example, the Apache integration mode is configured through the Apache configuration file; the Nginx integration mode is configured through the Nginx configuration file; while the Standalone mode configured through command line parameters and its own configuration file. Configuring Passenger for Standalone will have no effect on Passenger for Nginx.
As another example, starting and stopping Passenger Standalone instances will have no effect on Passenger for Apache.
Which mode should you use?
Here are some tips on how to decide on which integration mode to use.
- The Nginx mode is a good default choice for production
- The Nginx mode is what we recommend for most people in production environments. It's fast, easy to use, well-supported, has lots of features.
- The Standalone mode is a good default choice for development
- The Standalone mode is what we recommend for most people in development environments. It's very easy to use and requires practically no setup.
- Do you host multiple apps on a single server?
- Choose either the Apache or the Nginx integration mode.
- Using WebSockets? (e.g. using Meteor?)
- Choose the Nginx integration mode or the Standalone mode. WebSockets don't work so well over Apache. If you use Meteor, then you should know Meteor core technology relies on WebSockets, so Apache is out of the question.
- Are you already familiar with Nginx or Apache?
- Choose the integration mode for that web server.
- Are you a hardcore ops engineer or sysadmin with lots of experience, and do you want maximum control over your architecture while understanding how exactly every component works?
- Choose the Standalone mode.