# Multiple apps

**URL:** <https://www.ruby-forum.com/t/multiple-apps/191612>\
**Category:** NGINX\
**Created:** [July 15, 2010, 10:07am UTC](https://www.ruby-forum.com/t/multiple-apps/191612 "2010-07-15T10:07:57Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![vanderkerkoff](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/7feea3/32.png) [@vanderkerkoff](https://www.ruby-forum.com/u/vanderkerkoff)\
**Post date:** [July 15, 2010, 10:07am UTC](https://www.ruby-forum.com/t/multiple-apps/191612/1 "2010-07-15T10:07:57Z")

</div>

Hi there

We’re running 4 rails3beta4 apps with ruby 1.8.7 on passenger 2.2.15  
with nginx 0.7.65 on an Ubuntu 8.04 LTS unit. One of these apps has just  
been created and is not getting any traffic at the moment. I’ve just  
read that setting my idle timeout to be very high might solve this  
issue, but I’ll post it all up anyway in case it helps anyone else, or  
if raising the idle\_timeout value is not my solution.

Every morning for the last 3 mornings my monitoring system, God, sends  
me a message, nginx gave back 5 abnormal responses on the trot within a  
150 second time period

main nginx error log has lot’s of these, different process numbers

\*\*\* Exception Errno::EPIPE in Passenger RequestHandler (Broken pipe)  
(process 25985):  
from  
/home/username/src/passenger-2.2.15/lib/phusion\_passenger/rack/request\_handler.rb:94:in  
`write' from /home/username/src/passenger-2.2.15/lib/phusion_passenger/rack/request_handler.rb:94:in`process\_request’  
from  
/home/username/src/passenger-2.2.15/lib/phusion\_passenger/abstract\_request\_handler.rb:207:in  
`main_loop' from /home/username/src/passenger-2.2.15/lib/phusion_passenger/rack/application_spawner.rb:120:in`run’  
from  
/home/username/src/passenger-2.2.15/lib/phusion\_passenger/rack/application\_spawner.rb:65:in  
`spawn_application' from /home/username/src/passenger-2.2.15/lib/phusion_passenger/utils.rb:252:in`safe\_fork’  
from  
/home/username/src/passenger-2.2.15/lib/phusion\_passenger/rack/application\_spawner.rb:58:in  
`spawn_application' from /home/username/src/passenger-2.2.15/lib/phusion_passenger/rack/application_spawner.rb:41:in`spawn\_application’  
from  
/home/username/src/passenger-2.2.15/lib/phusion\_passenger/spawn\_manager.rb:150:in  
`spawn_application' from /home/username/src/passenger-2.2.15/lib/phusion_passenger/spawn_manager.rb:278:in`handle\_spawn\_application’  
from  
/home/username/src/passenger-2.2.15/lib/phusion\_passenger/abstract\_server.rb:352:in  
` __send__' from /home/username/src/passenger-2.2.15/lib/phusion_passenger/abstract_server.rb:352:in`main\_loop’  
from  
/home/username/src/passenger-2.2.15/lib/phusion\_passenger/abstract\_server.rb:196:in  
`start\_synchronously’  
from  
/home/username/src/passenger-2.2.15/bin/passenger-spawn-server:61

Also a number of these errors, with the same PID.

[ pid=20396 file=ext/nginx/HelperServer.cpp:484 time=2010-07-15  
08:13:06.732 ]:  
Couldn’t forward the HTTP response back to the HTTP client: It seems  
the user clicked on the ‘Stop’ button in his browser.

## Passenger-memory-stats says this ---------- Nginx processes ---------- PID PPID VMSize Private Name

20414 1 38.0 MB 0.4 MB nginx: master process  
/opt/nginx/sbin/nginx  
25928 20414 38.0 MB 1.0 MB nginx: worker process  
25930 20414 38.0 MB 0.5 MB nginx: worker process  
25933 20414 38.0 MB 0.5 MB nginx: worker process  
25935 20414 38.0 MB 0.5 MB nginx: worker process

### Processes: 5

### Total private dirty RSS: 3.07 MB

## ----- Passenger processes ------ PID VMSize Private Name

25910 24.0 MB 1.4 MB PassengerNginxHelperServer  
/home/username/src/passenger-2.2.15  
/opt/ruby-enterprise-1.8.7-2010.01/bin/ruby 3 4 0 6 0 300 1 nobody 1000  
1000 /tmp/passenger.20414  
25925 59.3 MB 8.0 MB Passenger spawn server  
25957 301.1 MB 120.0 MB Rack: /var/www/rails/b/current  
25982 195.6 MB 79.7 MB Rack: /var/www/rails/a/current

### Processes: 4

### Total private dirty RSS: 209.11 MB

Passenger-status says  
sudo /opt/ruby-enterprise-1.8.7-2010.01/bin/passenger-status  
It appears that multiple Passenger instances are running. Please select  
a  
specific one by running:

passenger-status

The following Passenger instances are running:  
PID: 20414  
PID: 20414

ls /tmp gives me two passenger pid files

sudo vi /tmp/passenger.20393/control\_process.pid gives me 20414  
sudo vi /tmp/passenger.20414/control\_process.pid gives me 20414

It looks like something caused the master nginx process to restart, but  
when it did so the old passenger stuff in /tmp/ didn’t get cleaned out  
properly and passenger thinks, quite correctly, that it’s running two  
instances of itself.

Is this a known problem with a particular setup I have?

I can restart god, which restarts nginx, which restarts the passenger  
processes properly and this problem goes away, until tomorrow 🙂

Any tips or help would be greatly appreciated.
