Permalink
Browse files

Merge branch 'passenger_prestart' of https://github.com/jarinudom/moo…

…nshine into jarinudom-passenger_prestart

* 'passenger_prestart' of https://github.com/jarinudom/moonshine:
  Add PassengerPreStart
  Add PassengerMinInstances
  • Loading branch information...
2 parents dc7e7ac + fd21574 commit 619eca59b96c25a61d926ce308398b699713df94 @wfarr wfarr committed Mar 16, 2011
Showing with 92 additions and 0 deletions.
  1. +92 −0 lib/moonshine/manifest/rails/templates/passenger.vhost.erb
View
92 lib/moonshine/manifest/rails/templates/passenger.vhost.erb
@@ -115,6 +115,52 @@
RailsSpawnMethod <%= configuration[:passenger][:rails_spawn_method] || 'smart' %>
+ ## PassengerMinInstances
+ #
+ # This specifies the minimum number of application instances that must be
+ # kept around whenever Phusion Passenger cleans up idle instances. You should
+ # set this option to a non-zero value if you want to avoid potentially long
+ # startup times after a website has been idle for an extended period.
+ #
+ # Please note that this option does not pre-start application instances during
+ # Apache startup. It just makes sure that when the application is first accessed:
+ # - at least the given number of instances will be spawned.
+ # - the given number of processes will be kept around even when instances are
+ # being idle cleaned (see PassengerPoolIdleTime).
+ #
+ # If you want to pre-start application instances during Apache startup, then you
+ # should use the PassengerPreStart directive, possibly in combination with
+ # PassengerMinInstances.
+
+ <% if configuration[:passenger][:min_instances] %>
+ PassengerMinInstances <%= configuration[:passenger][:min_instances] %>
+ <% end %>
+
+ ## PassengerPreStart
+ #
+ # By default, Phusion Passenger does not start any application instances
+ # until said web application is first accessed. The result is that the
+ # first visitor of said web application might experience a small delay as
+ # Phusion Passenger is starting the web application on demand. If that is
+ # undesirable, then this directive can be used to pre-started application
+ # instances during Apache startup.
+ #
+ # This directive only accepts a URL that fits the following criteria:
+ # - The domain part of the URL must be equal to the value of the ServerName
+ # directive of the VirtualHost block that defines the web application.
+ # - Unless the web application is deployed on port 80, the URL should
+ # contain the web application’s port number too.
+ # - The path part of the URL must point to some URI that the web
+ # application handles.
+ #
+ # You probably want to combine this with PassengerMinInstances.
+ #
+ # Example URL: http://example.com/
+
+ <% if configuration[:passenger][:pre_start_url] %>
+ PassengerPreStart <%= configuration[:passenger][:pre_start_url] %>
+ <% end %>
+
# Deflate
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE <%= configuration[:apache][:gzip_types].join(' ') %>
@@ -281,6 +327,52 @@
RailsSpawnMethod <%= configuration[:passenger][:rails_spawn_method] || 'smart' %>
+ ## PassengerMinInstances
+ #
+ # This specifies the minimum number of application instances that must be
+ # kept around whenever Phusion Passenger cleans up idle instances. You should
+ # set this option to a non-zero value if you want to avoid potentially long
+ # startup times after a website has been idle for an extended period.
+ #
+ # Please note that this option does not pre-start application instances during
+ # Apache startup. It just makes sure that when the application is first accessed:
+ # - at least the given number of instances will be spawned.
+ # - the given number of processes will be kept around even when instances are
+ # being idle cleaned (see PassengerPoolIdleTime).
+ #
+ # If you want to pre-start application instances during Apache startup, then you
+ # should use the PassengerPreStart directive, possibly in combination with
+ # PassengerMinInstances.
+
+ <% if configuration[:passenger][:min_instances] %>
+ PassengerMinInstances <%= configuration[:passenger][:min_instances] %>
+ <% end %>
+
+ ## PassengerPreStart
+ #
+ # By default, Phusion Passenger does not start any application instances
+ # until said web application is first accessed. The result is that the
+ # first visitor of said web application might experience a small delay as
+ # Phusion Passenger is starting the web application on demand. If that is
+ # undesirable, then this directive can be used to pre-started application
+ # instances during Apache startup.
+ #
+ # This directive only accepts a URL that fits the following criteria:
+ # - The domain part of the URL must be equal to the value of the ServerName
+ # directive of the VirtualHost block that defines the web application.
+ # - Unless the web application is deployed on port 80, the URL should
+ # contain the web application’s port number too.
+ # - The path part of the URL must point to some URI that the web
+ # application handles.
+ #
+ # You probably want to combine this with PassengerMinInstances.
+ #
+ # Example URL: http://example.com/
+
+ <% if configuration[:passenger][:pre_start_url] %>
+ PassengerPreStart <%= configuration[:passenger][:pre_start_url] %>
+ <% end %>
+
# Deflate
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE <%= configuration[:apache][:gzip_types].join(' ') %>

0 comments on commit 619eca5

Please sign in to comment.