Mongrel Configuration
Configuring a Mongrel Cluster
$ cd /your/rails/app/directory
$ mongrel_rails cluster::configure -e production -p 1xxxx -N 2
This generates a mongrel_cluster.yml file in your rails app’s config directory.
Options explanations:- -N 2: the number of mongrel instances to start (keep this low unless you’re on a business hosting plan)
- -p x: the port number to start the first mongrel instance on. The second instance is started on x + 1, etc. The ports that you may run mongrel instances on are 1xxx0-1xxx9 where xxx is the last 3 digits of your vu login.
- -e production: the environment to run the rails app in. Always run in production on PA servers, since development mode has memory leaks
Starting, stopping, and restarting a cluster
$ cd /your/rails/app/directory
$ mongrel_rails cluster::start
$ mongrel_rails cluster::stop
$ mongrel_rails cluster::restart
cluster::restart is handy when new code is uploaded, but not when the database structure is changed. In those cases, do a full stop and start.