Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add passenger_max_requests option per vhost #1517

Merged
merged 1 commit into from Jul 20, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions README.md
Expand Up @@ -2703,6 +2703,11 @@ Sets [PassengerRuby](https://www.phusionpassenger.com/library/config/apache/refe

Sets [PassengerMinInstances](https://www.phusionpassenger.com/library/config/apache/reference/#passengermininstances), the minimum number of application processes to run.

##### `passenger_max_requests`

Sets [PassengerMaxRequests](https://www.phusionpassenger.com/library/config/apache/reference/#pas
sengermaxrequests), the maximum number of requests an application process will process.

##### `passenger_max_instances_per_app`

Sets [PassengerMaxInstancesPerApp](https://www.phusionpassenger.com/library/config/apache/reference/#passengermaxinstancesperapp), the maximum number of application processes that may simultaneously exist for a single application.
Expand Down
4 changes: 3 additions & 1 deletion manifests/vhost.pp
Expand Up @@ -138,6 +138,7 @@
$passenger_app_env = undef,
$passenger_ruby = undef,
$passenger_min_instances = undef,
$passenger_max_requests = undef,
$passenger_start_timeout = undef,
$passenger_pre_start = undef,
$passenger_user = undef,
Expand Down Expand Up @@ -247,7 +248,7 @@
include ::apache::mod::suexec
}

if $passenger_app_root or $passenger_app_env or $passenger_ruby or $passenger_min_instances or $passenger_start_timeout or $passenger_pre_start or $passenger_user or $passenger_high_performance or $passenger_nodejs or $passenger_sticky_sessions or $passenger_startup_file {
if $passenger_app_root or $passenger_app_env or $passenger_ruby or $passenger_min_instances or $passenger_max_requests or $passenger_start_timeout or $passenger_pre_start or $passenger_user or $passenger_high_performance or $passenger_nodejs or $passenger_sticky_sessions or $passenger_startup_file {
include ::apache::mod::passenger
}

Expand Down Expand Up @@ -996,6 +997,7 @@
# - $passenger_app_env
# - $passenger_ruby
# - $passenger_min_instances
# - $passenger_max_requests
# - $passenger_start_timeout
# - $passenger_pre_start
# - $passenger_user
Expand Down
1 change: 1 addition & 0 deletions spec/defines/vhost_spec.rb
Expand Up @@ -396,6 +396,7 @@
'passenger_app_env' => 'test',
'passenger_ruby' => '/usr/bin/ruby1.9.1',
'passenger_min_instances' => '1',
'passenger_max_requests' => '1000',
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's similar to this configuration from apache.
https://httpd.apache.org/docs/2.4/en/mod/mpm_common.html#maxconnectionsperchild
Therefore you should set a non-zero value.

Copy link
Collaborator

@smortex smortex Oct 6, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My bad, did'nt realized this was in the spec directory!

Checking that this produce the expected configuration would have helped me detect this 😉

'passenger_start_timeout' => '600',
'passenger_pre_start' => 'http://localhost/myapp',
'passenger_high_performance' => true,
Expand Down
3 changes: 3 additions & 0 deletions templates/vhost/_passenger.erb
Expand Up @@ -10,6 +10,9 @@
<% if @passenger_min_instances -%>
PassengerMinInstances <%= @passenger_min_instances %>
<% end -%>
<% if @passenger_max_requests -%>
PassengerMaxRequests <%= @passenger_max_requests %>
<% end -%>
<% if @passenger_start_timeout -%>
PassengerStartTimeout <%= @passenger_start_timeout %>
<% end -%>
Expand Down