# Monitor fcgi?

**URL:** <https://www.ruby-forum.com/t/monitor-fcgi/101002>\
**Category:** Rails\
**Created:** [August 2, 2006, 5:21pm UTC](https://www.ruby-forum.com/t/monitor-fcgi/101002 "2006-08-02T17:21:57Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![john\_old](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/9f8e36/32.png) [@john\_old](https://www.ruby-forum.com/u/john_old)\
**Post date:** [August 2, 2006, 5:21pm UTC](https://www.ruby-forum.com/t/monitor-fcgi/101002/1 "2006-08-02T17:21:57Z")

</div>

Im trying to get a new app up on dreamhost. What fun 😕

Id like to try out the ‘frao\_handler’ which just keeps dreamhost from  
automatically killing my fcgi processes. But Im also worried about  
things getting out of hand. I seem to remember that captures in views  
can cause problems with fcgi (I might just be making that up???), and I  
do have few in my app. And well Im just not real fit with this stuff  
yet despite lots of reading and googling.

I read a lot of things talking about zombie fcgi processes. Well how  
does one monitor something like that? Is there a command I can run to  
monitor fcgi?

I hope someone can help.

thanks,  
john

---

<div class="post-metadata">

**Author:** ![john\_old](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/9f8e36/32.png) [@john\_old](https://www.ruby-forum.com/u/john_old)\
**Post date:** [August 2, 2006, 6:30pm UTC](https://www.ruby-forum.com/t/monitor-fcgi/101002/2 "2006-08-02T18:30:22Z")

</div>

john wrote:

> Well how  
> does one monitor something like that? Is there a command I can run to  
> monitor fcgi?

You can use my fcgi\_watch command. I wrote it especially to monitor fcgi  
processes on Dreamhost:-)

[http://www.alevans.com/dl/fcgi\_watch-0.3.1.tgz](http://www.alevans.com/dl/fcgi_watch-0.3.1.tgz)

–Al Evans

---

<div class="post-metadata">

**Author:** ![john\_old](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/9f8e36/32.png) [@john\_old](https://www.ruby-forum.com/u/john_old)\
**Post date:** [August 2, 2006, 7:15pm UTC](https://www.ruby-forum.com/t/monitor-fcgi/101002/3 "2006-08-02T19:15:34Z")

</div>

Wow thanks Al,

I just read through the readme real quick. Sounds fantastic. I admit  
that I didn’t really understand everything exactly but I just need to  
try it out I guess.

Thanks again!!!

Al Evans wrote:

> john wrote:
> 
> > Well how  
> > does one monitor something like that? Is there a command I can run to  
> > monitor fcgi?
> 
> You can use my fcgi\_watch command. I wrote it especially to monitor fcgi  
> processes on Dreamhost:-)
> 
> [http://www.alevans.com/dl/fcgi\_watch-0.3.1.tgz](http://www.alevans.com/dl/fcgi_watch-0.3.1.tgz)
> 
> –Al Evans

---

<div class="post-metadata">

**Author:** ![john\_old](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/9f8e36/32.png) [@john\_old](https://www.ruby-forum.com/u/john_old)\
**Post date:** [August 2, 2006, 8:09pm UTC](https://www.ruby-forum.com/t/monitor-fcgi/101002/4 "2006-08-02T20:09:33Z")

</div>

hehe,  
hey Al, can I ask you some questions about fcgi\_watch? I tried it out  
on my local (osx) machine and I get “-bash: script/fcgi\_watch:  
Permission denied” when I try to run it. I’ll just put it up on  
dreamhost though I guess and try it there because that’s the kind of  
cowboy I am. But I have other questions (all super noob stuff).

1. So I should use the “frao\_handler” in my dispatch.fcgi file to keep  
dreamhost fcgi killers out of there and then put your fcgi\_watch in my  
scripts directory?

2. Is that it? I realize that I can get a list of processes if I run  
fcgi\_watch manually and that I can restart my app with ‘restart’ and it  
will just kill processes related to that app. But do I need to activate  
it or anything to take over for the rails reaper.

Sorry if Ive totally missed the point. Any extra help would be great if  
you get a moment.

Thanks again,  
john

Al Evans wrote:

> john wrote:
> 
> > Well how  
> > does one monitor something like that? Is there a command I can run to  
> > monitor fcgi?
> 
> You can use my fcgi\_watch command. I wrote it especially to monitor fcgi  
> processes on Dreamhost:-)
> 
> [http://www.alevans.com/dl/fcgi\_watch-0.3.1.tgz](http://www.alevans.com/dl/fcgi_watch-0.3.1.tgz)
> 
> –Al Evans

---

<div class="post-metadata">

**Author:** ![john\_old](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/9f8e36/32.png) [@john\_old](https://www.ruby-forum.com/u/john_old)\
**Post date:** [August 3, 2006, 1:08am UTC](https://www.ruby-forum.com/t/monitor-fcgi/101002/5 "2006-08-03T01:08:17Z")

</div>

john wrote:

> hehe,  
> hey Al, can I ask you some questions about fcgi\_watch? I tried it out  
> on my local (osx) machine and I get “-bash: script/fcgi\_watch:  
> Permission denied” when I try to run it.

Hmm – my guess would be that for some reason, it doesn’t have  
executable permissions. chmod 755 script/fcgi\_watch should make it work.

> I’ll just put it up on  
> dreamhost though I guess and try it there because that’s the kind of  
> cowboy I am.

The same thing might be required there.

> 1. So I should use the “frao\_handler” in my dispatch.fcgi file to keep  
> dreamhost fcgi killers out of there and then put your fcgi\_watch in my  
> scripts directory?

I don’t use the ‘frao\_handler’. When I first started with DH, it seemed  
to make things worse, rather than better. My impression was that it  
_did_ restart the FCGI dispatchers, but they were never actually used  
again. Other people seem to have gotten different results. My advice  
would be to try it, and see if you have to kill -9 large numbers of  
dispatchers on a regular basis. If not, you’re cool

I do, however, run a pinger script on my local machine. It just submits  
a request to some controller in each of my DH Rails apps every ten  
minutes. This seems to keep them responsive, without making them spawn  
bunches of FCGI dispatchers. If it’s unsuccessful, it shows me the error  
it got. The past couple of weeks, this has been depressing:-)

> 1. Is that it? I realize that I can get a list of processes if I run  
> fcgi\_watch manually and that I can restart my app with ‘restart’ and it  
> will just kill processes related to that app. But do I need to activate  
> it or anything to take over for the rails reaper.

No, you just use it instead of the reaper. The reaper doesn’t do  
anything unless it’s called, manually or from a script. If you have  
scripts that call it, you might want to substitute calls to fcgi\_watch  
instead.

–Al Evans

---

<div class="post-metadata">

**Author:** ![john\_old](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/9f8e36/32.png) [@john\_old](https://www.ruby-forum.com/u/john_old)\
**Post date:** [August 3, 2006, 9:03am UTC](https://www.ruby-forum.com/t/monitor-fcgi/101002/6 "2006-08-03T09:03:36Z")

</div>

Al Evans wrote:

> No, you just use it instead of the reaper. The reaper doesn’t do  
> anything unless it’s called, manually or from a script. If you have  
> scripts that call it, you might want to substitute calls to fcgi\_watch  
> instead.
> 
> –Al Evans

I get it. Great! I had never used the reaper before. So this is  
exactly what I was looking for when I first posted. Fantastic.

Man… From my logs it seems like my site is responding better on my  
laptop running webbrick than it is on dreamhost! And of course I don’t  
get these errors all the time locally either. nuts.

Anyway thanks for all your help,  
john
