cpanel and mod passenger with PassengerMinInstances 1 not working

472 views
Skip to first unread message

James Tt

unread,
Mar 24, 2016, 10:37:29 AM3/24/16
to Phusion Passenger Discussions

im using centos 6 with cpanel with mod passenger. i tried to configure extra custom apache configuration for a domain, and vi /usr/local/apache/conf/userdata/std/2/username/domain.com/rails.conf

and configured:

PassengerMinInstances 1

PassengerMaxPoolSize 3

but the instance seems to auto shutdown after 5minutes of inactive

anyone encounter similar issue?


Daniel Knoppel

unread,
Mar 24, 2016, 11:14:04 AM3/24/16
to Phusion Passenger Discussions
5 min is the default instance timeout time when no mininstances is set. Anything above the minimum configured will auto-timeout.

Are you 100% sure passenger is using that config? For example, if you change the PassengerMaxPoolSize to 9 and do passenger-status, does it show that the max is 9?

- Daniel

James Tt

unread,
Mar 24, 2016, 11:45:02 AM3/24/16
to Phusion Passenger Discussions
hi,

you are right, i tried to set maxpoolsize to 6
passenger-status seems to show same 3

what could go wrong?
my apache does not throw any configuration error,
and ive restarted apache after the update

here is my config:
Alias /shop /home/username/rails/current/public

PassengerRuby /usr/local/rvm/gems/ruby-2.2.2/wrappers/ruby
PassengerMinInstances 1
PassengerMaxPoolSize 5
<Directory /home/username/rails/current/public>
SetEnv RAILS_RELATIVE_URL_ROOT "/shop"
PassengerAppRoot /home/username/rails/current
PassengerBaseURI /shop
Options -MultiViews
AllowOverride All
Allow from All

</Directory>

<Location /assets/>
# Use of ETag is discouraged when Last-Modified is present
Header unset ETag
FileETag None
# RFC says only cache for 1 year
ExpiresActive On
ExpiresDefault "access plus 1 year"
</Location>


PassengerRuby seems to work.
and SetEnv RAILS_RELATIVE_URL_ROOT also working

i tried to move PassengerMinInstances into directory config block, it throws apache configuration error

is there any other place to set this correctly?

thanks

Daniel Knoppel

unread,
Mar 24, 2016, 12:59:52 PM3/24/16
to Phusion Passenger Discussions
What could be happening is that it is just using a different config file from somewhere else. Maybe do a text search for something like PassengerMaxPoolSize.

- Daniel

James Tt

unread,
Mar 24, 2016, 11:40:16 PM3/24/16
to Phusion Passenger Discussions

Hi Daniel,


ive checked,

cpanel load the include file within the block virtualhost

didnt work.

i searched for PassengerMaxPoolSize, cant find



wait. is this applicable only in enterprise edition?


Daniel Knoppel

unread,
Mar 25, 2016, 5:45:14 AM3/25/16
to Phusion Passenger Discussions
Max pool size? No, standard open source feature. It would give an error otherwise.

If cpanel is really using the file then the only thing I can think of is that you're trying to configure the same application in multiple domains. If you try to do this, the settings (like the max pool size) from one domain will overwrite the other (depending on which domain gets the last request).

If this is the case you should solve it by assigning different app groups:

- Daniel 

James Tt

unread,
Mar 27, 2016, 10:56:17 PM3/27/16
to Phusion Passenger Discussions
hi Daniel,

isn't passenger configuration group within virtualhost directive?
ive even tried to set it under global configuration, it doesnt seems to work.
does cloud linux have any effect on this?

James Tt

unread,
Mar 27, 2016, 11:40:57 PM3/27/16
to Phusion Passenger Discussions
hi Daniel,

ive added
PassengerAppGroupName "mydomain.com group"

passenger-status shows:
*** Cleaning stale instance directory /tmp/passenger.8Y8dUtk
    Warning: Operation not permitted @ rb_file_chown - /tmp/passenger.8Y8dUtk/.
*** Cleaning stale instance directory /tmp/passenger.8W0tzLe
    Warning: Operation not permitted @ rb_file_chown - /tmp/passenger.8W0tzLe/.
*** Cleaning stale instance directory /tmp/passenger.cknU2Z0
    Warning: Operation not permitted @ rb_file_chown - /tmp/passenger.cknU2Z0/.
*** Cleaning stale instance directory /tmp/passenger.OgAYEVb
    Warning: Operation not permitted @ rb_file_chown - /tmp/passenger.OgAYEVb/.
Version : 5.0.23
Date    : 2016-03-28 11:37:18 +0800
Instance: Ni6OGeR8 (Apache/2.4.16 (Unix) OpenSSL/1.0.1e-fips Phusion_Passenger/5.0.21)

----------- General information -----------
Max pool size : 3
App groups    : 8
Processes     : 3
Requests in top-level queue : 0

----------- Application groups -----------
  App root: /home/mydomain/rails/current
  Requests in queue: 0
  * PID: 629669   Sessions: 0       Processed: 1       Uptime: 14s
    CPU: 7%      Memory  : 85M     Last used: 14s ago


will it show group based max pool?
my max pool is set to 5, but it does not show anywhere...



On Friday, 25 March 2016 17:45:14 UTC+8, Daniel Knoppel wrote:

Daniel Knoppel

unread,
Mar 29, 2016, 4:40:33 AM3/29/16
to Phusion Passenger Discussions
Sorry, I worded it incorrectly; 
1) The max pool size is a global setting, not per application. See documentation: https://www.phusionpassenger.com/library/config/apache/reference/#passengermaxpoolsize

2) The problem you reported was with min instances seemingly not being respected, that is a per group setting and should be solved now if you configure it for that group.

- Daniel

James Tt

unread,
Mar 29, 2016, 12:11:11 PM3/29/16
to Phusion Passenger Discussions
hi Daniel,

okay, my concern is min instances,
how do i know if min instances is working?
from my test, adding 

PassengerMinInstances 1 within

  • Virtualhost (not working)
  • Virtualhost > Directory (public - also not working)


the instance will auto shutdown

Daniel Knoppel

unread,
Mar 30, 2016, 4:50:23 AM3/30/16
to Phusion Passenger Discussions
Version : 5.0.23
Date    : 2016-03-28 11:37:18 +0800
Instance: Ni6OGeR8 (Apache/2.4.16 (Unix) OpenSSL/1.0.1e-fips Phusion_Passenger/5.0.21)

You have multiple versions of Passenger installed according to this output. You can try removing the older versions and installing the latest (5.0.26).

- Daniel

James Tt

unread,
Mar 30, 2016, 5:52:29 AM3/30/16
to phusion-...@googlegroups.com
hi Daniel,

no matter version 5.0.23 or 5.0.21, it should support min instance ,
i dont think this version differences should matter


------------------
If any attachment content power point (.pps / .ppt), please use google slideshow to open for safe precaution.

--
You received this message because you are subscribed to a topic in the Google Groups "Phusion Passenger Discussions" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/phusion-passenger/XPZPZLUSZJo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to phusion-passen...@googlegroups.com.
To post to this group, send email to phusion-...@googlegroups.com.
Visit this group at https://groups.google.com/group/phusion-passenger.
To view this discussion on the web visit https://groups.google.com/d/msgid/phusion-passenger/a53ce755-cd68-45d8-8c1b-b1d4ef6980d4%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Daniel Knoppel

unread,
Mar 30, 2016, 7:57:16 AM3/30/16
to Phusion Passenger Discussions
What I'm trying to say is that using two different passenger versions mixed is likely to cause problems. I don't know what you are using it for but you can already see strange things happening in your passenger-status where it's detecting stale instance directories and failing to clean them, that's not supposed to happen. I can easily imagine your config isn't working as expected either because different settings are getting mixed.

N.B. we haven't gotten any other reports about this, and I haven't seen any problems with the setting since the fix we did in 5.0.8.

- Daniel


On Wednesday, March 30, 2016 at 11:52:29 AM UTC+2, James Tt wrote:
hi Daniel,

no matter version 5.0.23 or 5.0.21, it should support min instance ,
i dont think this version differences should matter


------------------
If any attachment content power point (.pps / .ppt), please use google slideshow to open for safe precaution.

James Tt

unread,
Mar 30, 2016, 11:18:46 PM3/30/16
to Phusion Passenger Discussions
hi Daniel,

okay, ive updated it to use same version.
i got the feeling that if my session is logged into server,
the passenger-status seems to remain 1 instance,
but when i log out from shell after 20minutes and tried to open the rails url,
it seems to restarting the instance again...

passenger-status

*** Cleaning stale instance directory /tmp/passenger.8Y8dUtk

    Warning: Operation not permitted @ rb_file_chown - /tmp/passenger.8Y8dUtk/.

*** Cleaning stale instance directory /tmp/passenger.8W0tzLe

    Warning: Operation not permitted @ rb_file_chown - /tmp/passenger.8W0tzLe/.

*** Cleaning stale instance directory /tmp/passenger.cknU2Z0

    Warning: Operation not permitted @ rb_file_chown - /tmp/passenger.cknU2Z0/.

*** Cleaning stale instance directory /tmp/passenger.Yz1w1IN

    Warning: Operation not permitted @ rb_file_chown - /tmp/passenger.Yz1w1IN/.

*** Cleaning stale instance directory /tmp/passenger.OgAYEVb

    Warning: Operation not permitted @ rb_file_chown - /tmp/passenger.OgAYEVb/.

Version : 5.0.26

Date    : 2016-03-31 11:16:08 +0800

Instance: xhAtiTqn (Apache/2.4.16 (Unix) OpenSSL/1.0.1e-fips Phusion_Passenger/5.0.26)



----------- General information -----------

Max pool size : 3

App groups    : 5

Processes     : 2

Requests in top-level queue : 0


----------- Application groups -----------

mydomain.com group:

  App root: /home/myuser/rails/production

  Requests in queue: 0


James Tt

unread,
Mar 30, 2016, 11:37:45 PM3/30/16
to Phusion Passenger Discussions
ok this time i kept my shell open with top -U myusername,

after 10minutes, the ruby instance is gone,
when i visit the url, 2 ruby instance running, 
after awhile, only 1 ruby instance is running, i think the mininstance is working.
but after 10minutes, 0 ruby instance is running.
how can i maintain at least 1 instance running for infinity time?
Reply all
Reply to author
Forward
0 new messages