# Nginx and/or Passenger failing

**URL:** <https://www.ruby-forum.com/t/nginx-and-or-passenger-failing/212254>\
**Category:** NGINX\
**Created:** [September 27, 2011, 9:54am UTC](https://www.ruby-forum.com/t/nginx-and-or-passenger-failing/212254 "2011-09-27T09:54:46Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![dubstep](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/cdc98d/32.png) [@dubstep](https://www.ruby-forum.com/u/dubstep)\
**Post date:** [September 27, 2011, 9:54am UTC](https://www.ruby-forum.com/t/nginx-and-or-passenger-failing/212254/1 "2011-09-27T09:54:46Z")

</div>

Hi,

Envirionment:  
Passenger 3.0.9  
nginx 1.0.6  
Suse SLE 11  
Rails 3.0.7  
Ruby 1.9.2 p136  
Quad core  
8 GB  
Single Rails application

nginx settings:

worker\_processes 3;  
worker\_rlimit\_nofile 8192;  
worker\_priority 0;  
events {  
multi\_accept off;  
worker\_connections 4096;  
}

pid /var/run/nginx.pid;  
error\_log logs/error.log debug;  
http {  
passenger\_root  
/usr/local/rvm/gems/ruby-1.9.2-p136/gems/passenger-3.0.9;  
passenger\_ruby /usr/local/rvm/wrappers/ruby-1.9.2-p136/ruby;  
passenger\_max\_pool\_size 4;  
passenger\_min\_instances 1;  
keepalive\_timeout 180;  
client\_body\_buffer\_size 128k;  
client\_header\_buffer\_size 2k;  
large\_client\_header\_buffers 32 64k;  
passenger\_pool\_idle\_time 300;  
passenger\_log\_level 2;  
passenger\_use\_global\_queue on;  
include /opt/nginx/conf/mime.types;  
default\_type application/octet-stream;  
log\_format main '$remote\_addr - $remote\_user [$time\_local] ’  
'“$request” $status $bytes\_sent ’  
'“$http\_referer” “$http\_user\_agent” ’  
‘“$gzip\_ratio”’;  
access\_log logs/access.log main;  
sendfile on;  
tcp\_nopush on;  
tcp\_nodelay off;  
gzip on;  
gzip\_http\_version 1.0;  
gzip\_comp\_level 2;  
gzip\_proxied any;  
gzip\_min\_length 1000;  
gzip\_types text/plain text/css application/x-javascript  
text/xml application/xml application/xml+rss text/javascript;  
…

I’m not sure if the problem lies with passenger or nginx, after a period  
of time the passenger as well as the nginx master process shuts down.  
When I look in the log file I have the following:

2011/09/27 16:45:36 [info] 6408#0: \*204 client 61.88.141.194 closed  
keepalive connection  
[ pid=6381 thr=140088026498848  
file=ext/common/LoggingAgent/LoggingServer.h:829 time=2011-09-27  
16:45:46.849 ]: Flushing all sinks (periodic action)  
[ pid=6381 thr=140088026498848  
file=ext/common/LoggingAgent/LoggingServer.h:829 time=2011-09-27  
16:46:01.848 ]: Flushing all sinks (periodic action)  
[ pid=6381 thr=140088026498848  
file=ext/common/LoggingAgent/LoggingServer.h:829 time=2011-09-27  
16:46:16.848 ]: Flushing all sinks (periodic action)  
[ pid=6381 thr=140088026498848  
file=ext/common/LoggingAgent/LoggingServer.h:829 time=2011-09-27  
16:46:31.848 ]: Flushing all sinks (periodic action)  
[ pid=6381 thr=140088026498848  
file=ext/common/LoggingAgent/LoggingServer.h:829 time=2011-09-27  
16:46:46.849 ]: Flushing all sinks (periodic action)  
[ pid=6381 thr=140088026498848  
file=ext/common/LoggingAgent/LoggingServer.h:829 time=2011-09-27  
16:47:01.849 ]: Flushing all sinks (periodic action)  
[ pid=6381 thr=140088026498848  
file=ext/common/LoggingAgent/LoggingServer.h:829 time=2011-09-27  
16:47:16.848 ]: Flushing all sinks (periodic action)  
[ pid=6381 thr=140088026498848  
file=ext/common/LoggingAgent/LoggingServer.h:829 time=2011-09-27  
16:47:31.848 ]: Flushing all sinks (periodic action)  
[ pid=6371 thr=139975134312192 file=ext/common/Watchdog.cpp:1057  
time=2011-09-27 16:47:38.756 ]: Web server did not exit gracefully,  
forcing shutdown of all service processes…  
2011/09/27 16:49:00 [crit] 6410#0: \*250 connect() to  
unix:/passenger\_helper\_server failed (2: No such file or directory)  
while connecting to upstream, client: 120.146.194.176, serv  
er: localhost, request: “GET /candidates/new HTTP/1.1”, upstream:  
“passenger:unix:/passenger\_helper\_server:”, host: “61.88.141.221”,  
referrer: “[http://61.88.141.221/home/view\_repor](http://61.88.141.221/home/view_repor)  
ts”

When I look at the running processes the nginx master is no longer  
running but the workers are still running, I have to kill them before I  
can restart. All passenger processes are not longer running.

As I said I’m not sure which process is causing the other to close and I  
have no idea what the problem may be, so any help greatly appreciated.

Etienne.

Posted at Nginx Forum:

> **[Nginx and/or Passenger failing](https://forum.nginx.org/read.php?2,215871,215871#msg-215871)**
>
> Hi, Envirionment: Passenger 3.0.9 nginx 1.0.6 Suse SLE 11 Rails 3.0.7 Ruby 1.9.2 p136 Quad core 8 GB Single Rails application nginx settings: worker\_processes 3; worker\_rlimit\_nofile

---

<div class="post-metadata">

**Author:** ![springbok](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/dfb087/32.png) [@springbok](https://www.ruby-forum.com/u/springbok)\
**Post date:** [September 27, 2011, 10:57am UTC](https://www.ruby-forum.com/t/nginx-and-or-passenger-failing/212254/2 "2011-09-27T10:57:19Z")

</div>

## Sergey A. Osokin Wrote:

> ```
> passenger_root
> root
> 
> 0:00,09 PassengerHelperAgent
> 
> ```
> 
> host.  
> nginx mailing list  
> [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
> [mailman.nginx.org archive](http://mailman.nginx.org/mailman/listinfo/nginx)

Hi Sergey,

Thank you so much for the prompt reply.

Sorry I just can’t get this working, nginx fires up ok but nothing  
happens when I telnet. I checked passenger using passenger-status  
–verbose  
and it shows the details for passenger but when I check for running  
passenger processes it’s not running.

When I do GET / HTTP/1.0 nothing happens.

Am I missing something?

user …;  
events {  
multi\_accept off;  
worker\_connections 4096;  
}

http {  
include mime.types;  
default\_type application/octet-stream;

passenger\_root  
/usr/local/rvm/gems/ruby-1.9.2-p136/gems/passenger-3.0.9;  
passenger\_ruby /usr/local/rvm/wrappers/ruby-1.9.2-p136/ruby;

passenger\_default\_user …;

server {  
listen 80;  
server\_name localhost;

root /home/etienne/test/stub/rack/public;  
passenger\_enabled on;  
passenger\_use\_global\_queue on;  
}  
}

Posted at Nginx Forum:  
[http://forum.nginx.org/read.php?2,215871,215876#msg-215876](http://forum.nginx.org/read.php?2,215871,215876#msg-215876)

---

<div class="post-metadata">

**Author:** ![springbok](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/dfb087/32.png) [@springbok](https://www.ruby-forum.com/u/springbok)\
**Post date:** [September 27, 2011, 10:22am UTC](https://www.ruby-forum.com/t/nginx-and-or-passenger-failing/212254/3 "2011-09-27T10:22:00Z")

</div>

On Tue, Sep 27, 2011 at 03:54:07AM -0400, springbok wrote:

> Single Rails application
> 
> ```
> client_header_buffer_size 2k;
> access_log logs/access.log main;
> 
> ```
> 
> …  
> [ pid=6381 thr=140088026498848  
> 16:46:46.849 ]: Flushing all sinks (periodic action)  
> time=2011-09-27 16:47:38.756 ]: Web server did not exit gracefully,  
> running but the workers are still running, I have to kill them before I  
> can restart. All passenger processes are not longer running.
> 
> As I said I’m not sure which process is causing the other to close and I  
> have no idea what the problem may be, so any help greatly appreciated.

Could you try very simple config with small application from passenger  
distro, i.e. something like this.

http {  
include mime.types;  
default\_type application/octet-stream;

```
passenger_root 

```

/usr/local/rvm/gems/ruby-1.9.2-p136/gems/passenger-3.0.9;  
passenger\_ruby /usr/local/rvm/wrappers/ruby-1.9.2-p136/ruby;  
passenger\_default\_user www;

```
server {
    listen 127.0.0.1:80;
    server_name localhost;

    root 

```

/usr/local/rvm/gems/ruby-1.9.2-p136/gems/passenger-3.0.9/test/stub/rack/public;  
passenger\_enabled on;  
passenger\_use\_global\_queue on;  
}  
}

After restart your nginx with passenger you should find nginx and  
passenger  
processes.

% ps auxww | grep nginx | grep -v nginx  
root 18932 4,0 15,9 44464 39656 ?? Ss 8:46 0:00,01 nginx:  
master process /usr/local/sbin/nginx  
www 18933 4,0 16,0 44464 39904 ?? S 8:46 0:00,02 nginx:  
worker process (nginx)  
% ps uaxww | grep -i passenger | grep -v grep  
root 18923 0,0 1,0 5760 2508 ?? Is 8:46 0:00,07  
PassengerWatchdog  
root 18926 0,0 1,5 15052 3820 ?? I 8:46 0:00,09  
PassengerHelperAgent  
root 18929 0,0 2,7 13176 6620 ?? I 8:46 0:01,75 ruby:  
Passenger spawn server (ruby)  
nobody 18930 0,0 1,4 6688 3600 ?? I 8:46 0:00,07  
PassengerLoggingAgent

% telnet 127.0.0.1 80  
Trying 127.0.0.1…  
Connected to localhost.  
Escape character is ‘^]’.  
GET / HTTP/1.0

HTTP/1.1 200 OK  
Content-Type: text/html  
Connection: close  
Status: 200  
X-Powered-By: Phusion Passenger (mod\_rails/mod\_rack) 3.0.9  
Server: nginx/1.0.6 + Phusion Passenger 3.0.9 (mod\_rails/mod\_rack)

hello **world** Connection closed by foreign host.

Does it possible reproduce your problem for simple configuration?

–  
Sergey A. Osokin  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![springbok](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/dfb087/32.png) [@springbok](https://www.ruby-forum.com/u/springbok)\
**Post date:** [September 27, 2011, 11:36am UTC](https://www.ruby-forum.com/t/nginx-and-or-passenger-failing/212254/4 "2011-09-27T11:36:19Z")

</div>

Ok, I’ve got passenger loading and appearing in the process list, I  
created a index.html file and was able to display it doing a GET / but  
when I try GET / HTTP/1.0 it just sits there and nothing happens. If I  
remove the index.html I get “Hello world” returned, no mention of  
passenger.

Posted at Nginx Forum:

> **[Re: Nginx and/or Passenger failing](https://forum.nginx.org/read.php?2,215871,215879#msg-215879)**
>
> Hi, Envirionment: Passenger 3.0.9 nginx 1.0.6 Suse SLE 11 Rails 3.0.7 Ruby 1.9.2 p136 Quad core 8 GB Single Rails application nginx settings: worker\_processes 3; worker\_rlimit\_nofile

---

<div class="post-metadata">

**Author:** ![springbok](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/dfb087/32.png) [@springbok](https://www.ruby-forum.com/u/springbok)\
**Post date:** [September 27, 2011, 11:11am UTC](https://www.ruby-forum.com/t/nginx-and-or-passenger-failing/212254/5 "2011-09-27T11:11:33Z")

</div>

## springbok Wrote:

> > ```
> > include mime.types;
> > 
> > passenger_use_global_queue on;
> > 
> > ```
> 
> 8:46  
> 8:46
> 
> > Connected to localhost.  
> > (mod\_rails/mod\_rack)  
> > [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
> 
> server\_name localhost;
> 
> root /home/etienne/test/stub/rack/public;  
> passenger\_enabled on;  
> passenger\_use\_global\_queue on;  
> }  
> }

Hi Sergey,

One other thing I’d mention is that our application works great for most  
of the time but intermittently it fails with the symptoms I describe so  
I’m not sure I can reproduce it with the simple setup if I did get it  
going.

Regards,

Etienne.

Posted at Nginx Forum:  
[http://forum.nginx.org/read.php?2,215871,215877#msg-215877](http://forum.nginx.org/read.php?2,215871,215877#msg-215877)

---

<div class="post-metadata">

**Author:** ![springbok](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/dfb087/32.png) [@springbok](https://www.ruby-forum.com/u/springbok)\
**Post date:** [September 27, 2011, 1:02pm UTC](https://www.ruby-forum.com/t/nginx-and-or-passenger-failing/212254/6 "2011-09-27T13:02:16Z")

</div>

On Tue, Sep 27, 2011 at 05:35:57AM -0400, springbok wrote:

> Ok, I’ve got passenger loading and appearing in the process list, I  
> created a index.html file and was able to display it doing a GET / but  
> when I try GET / HTTP/1.0 it just sits there and nothing happens. If I  
> remove the index.html I get “Hello world” returned, no mention of  
> passenger.

So, if you got "Hello, **world** this means passenger works well with  
default installation. Could you please check your application or try to  
use  
previous version of nginx and/or passenger.

–  
Sergey A. Osokin  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![springbok](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/dfb087/32.png) [@springbok](https://www.ruby-forum.com/u/springbok)\
**Post date:** [September 27, 2011, 5:39pm UTC](https://www.ruby-forum.com/t/nginx-and-or-passenger-failing/212254/7 "2011-09-27T17:39:34Z")

</div>

On Tue, Sep 27, 2011 at 10:03:30AM -0400, springbok wrote:

> > > remove the index.html I get “Hello world”  
> > > Sergey A. Osokin  
> > > I was using 0.8.53 when I started getting the errors and decided to  
> > > upgrade before posting my question.
> 
> Do you believe this is an nginx or passenger problem, is nginx causing  
> passenger to shutdown or the other way around?

I don’t know.

> To me it looks like the  
> watchdog process is getting an error from nginx and closing the  
> passenger processes.

I think you should ask about your problem authors of passenger at first.

> I just really don’t know where to start looking, could it be something  
> external for example the DB the app uses is running on a different  
> server maybe it’s a network problem, what about rogue messages is that  
> possible, the IT manager did say he removed the firewall to the machine.  
> I’m sure he has something else in place, but this app has been running  
> fine for the last 6 months, it only started happening after the weekend  
> when we went live and the DB was moved from the same machine to  
> another.
> 
> Sorry for all the questions but I’m really stumped and don’t know what  
> to try next.

–  
Sergey A. Osokin  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![springbok](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/dfb087/32.png) [@springbok](https://www.ruby-forum.com/u/springbok)\
**Post date:** [September 27, 2011, 4:03pm UTC](https://www.ruby-forum.com/t/nginx-and-or-passenger-failing/212254/8 "2011-09-27T16:03:51Z")

</div>

## Sergey A. Osokin Wrote:

> > passenger.  
> > [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
> 
> * * *
> 
> nginx mailing list  
> [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
> [mailman.nginx.org archive](http://mailman.nginx.org/mailman/listinfo/nginx)

Hi Sergey,

I was using 0.8.53 when I started getting the errors and decided to  
upgrade before posting my question.

Do you believe this is an nginx or passenger problem, is nginx causing  
passenger to shutdown or the other way around? To me it looks like the  
watchdog process is getting an error from nginx and closing the  
passenger processes.

We have 8GB of memory and 4 processors, do you think it could be memory  
related/CPU load related, I know it’s difficult to say without seeing  
our app and the load it places on the system, but if you had to guess?  
It has plenty of memory available so I don’t think that’s a problem, the  
IT manager for the client which I developed the app is convinced the  
shutdown is caused by CPU load. When monitoring the load the passenger  
processes spike up to around 50-80% but settle down to 10% of less when  
idling, at the moment they are \< 1% as the load is low. The shutdown has  
happened when there is not a lot of load so I’m not convinced.

I just really don’t know where to start looking, could it be something  
external for example the DB the app uses is running on a different  
server maybe it’s a network problem, what about rogue messages is that  
possible, the IT manager did say he removed the firewall to the machine.  
I’m sure he has something else in place, but this app has been running  
fine for the last 6 months, it only started happening after the weekend  
when we went live and the DB was moved from the same machine to  
another.

Sorry for all the questions but I’m really stumped and don’t know what  
to try next.

Thanks again for your help.

Etienne.

Posted at Nginx Forum:  
[http://forum.nginx.org/read.php?2,215871,215902#msg-215902](http://forum.nginx.org/read.php?2,215871,215902#msg-215902)
