multiple apps

Matt Davies lists at ruby-forum.com
Thu Jul 15 12:07:57 MSD 2010


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 <PID>

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.
-- 
Posted via http://www.ruby-forum.com/.



More information about the nginx mailing list