# Ruby app hangs when no new requests come in to http server

**URL:** <https://www.ruby-forum.com/t/ruby-app-hangs-when-no-new-requests-come-in-to-http-server/129850>\
**Category:** Rails\
**Created:** [February 22, 2008, 2:09am UTC](https://www.ruby-forum.com/t/ruby-app-hangs-when-no-new-requests-come-in-to-http-server/129850 "2008-02-22T02:09:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rodre](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/9f8e36/32.png) [@Rodre](https://www.ruby-forum.com/u/Rodre)\
**Post date:** [February 22, 2008, 2:09am UTC](https://www.ruby-forum.com/t/ruby-app-hangs-when-no-new-requests-come-in-to-http-server/129850/1 "2008-02-22T02:09:45Z")

</div>

Hello,

I am new to ruby on rails so pardon any ignorance, indiscretions, etc.  
I have inherited the administration of a RoR web app that runs under  
mongrel. My problem is that as long as there are http requests coming  
in the application stays responsive indefinitely, however, when no  
reguests come in it appears as though the app hangs. The browser times  
out with:

Proxy Error

The proxy server received an invalid response from an upstream server.  
The proxy server could not handle the request GET /.

Reason: Error reading from remote server

Apache/2.0.52 (Red Hat) Server at 204.xx.xx.xx Port 80

the funny thing is that if I request an image from the /images  
directory it serves the image up fine. I am running:

RHEL5 x64  
Apache/2.0.52  
Mongrel 1.1.3  
Ruby 1.8.5

Has anyone seen this before?

~Rodre

---

<div class="post-metadata">

**Author:** ![Rodre](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/9f8e36/32.png) [@Rodre](https://www.ruby-forum.com/u/Rodre)\
**Post date:** [February 22, 2008, 3:49am UTC](https://www.ruby-forum.com/t/ruby-app-hangs-when-no-new-requests-come-in-to-http-server/129850/2 "2008-02-22T03:49:48Z")

</div>

Check your production log if there’s any error.

I think your server is rebooted. try this:

[~] crontab -e

* * *

#clear out pid files if they didn’t get erased  
@reboot cd /home/username/railsapp/log && rm mongrel.4\* -f

#reboot first instance (all one line)  
@reboot cd /home/username/railsapp && /usr/local/bin/mongrel\_rails start  
-e production -d -p 4_**0 -P  
/home/username/railsapp/log/mongrel.4**_0.pid

#reboot second instance (all one line)  
@reboot cd /home/username/railsapp && /usr/local/bin/mongrel\_rails start  
-e production -d -p 4_**1 -P  
/home/username/railsapp/log/mongrel.4**_1.pid

#reboot more instances in a similar manner

* * *

Be sure to triple-check that you get this file correct. Make sure your  
username, railsapp, and port (4\*\*\*) are plugged in correctly. Note that  
the final digit of the port will increase 0,1,2,3,etc…

~_~_~_~_~_~_~_~_~_~_~_~_~_~_~\*  
Reinhart Ariando  
YM : Booking2Heaven  
Web: [Teapoci.Blogspot.com](http://Teapoci.Blogspot.com)  
~_~_~_~_~_~_~_~_~_~_~_~_~_~_~\*
