# The fastcgi crash after few hours

**URL:** <https://www.ruby-forum.com/t/the-fastcgi-crash-after-few-hours/55801>\
**Category:** Rails\
**Created:** [March 23, 2006, 10:57pm UTC](https://www.ruby-forum.com/t/the-fastcgi-crash-after-few-hours/55801 "2006-03-23T22:57:22Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![reis](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/f1d935/32.png) [@reis](https://www.ruby-forum.com/u/reis)\
**Post date:** [March 23, 2006, 10:57pm UTC](https://www.ruby-forum.com/t/the-fastcgi-crash-after-few-hours/55801/1 "2006-03-23T22:57:22Z")

</div>

I have this configuration on my server

- Windows 2000 server
- Apache 2.0.55
- MySQL 5.x
- Rails 1.0

For the moment I have a rails app that run on Apache with fastcgi. After  
some hours i use the application the fastcgi go down and so the web app  
is so slow (with cgi).  
The error in RAILS\_ROOT/log/fastcgi.crash.log is:

[23/Mar/2006:09:11:23 :: 5668] Ignoring unsupported signal USR1.  
[23/Mar/2006:09:11:23 :: 5668] Ignoring unsupported signal USR2.  
[23/Mar/2006:09:11:23 :: 5668] Ignoring unsupported signal HUP.  
[23/Mar/2006:09:11:23 :: 5668] starting

Thanks so much for the time  
–Andrea R.

---

<div class="post-metadata">

**Author:** ![reis](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/f1d935/32.png) [@reis](https://www.ruby-forum.com/u/reis)\
**Post date:** [March 23, 2006, 11:26pm UTC](https://www.ruby-forum.com/t/the-fastcgi-crash-after-few-hours/55801/2 "2006-03-23T23:26:54Z")

</div>

Not enough info for me to tell right off the bat, but could you please  
paste  
the piece of your Apache configuration for your Rails application? I’ve  
got  
the same configuration running for over five weeks without a problem.

---

<div class="post-metadata">

**Author:** ![reis](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/f1d935/32.png) [@reis](https://www.ruby-forum.com/u/reis)\
**Post date:** [March 24, 2006, 10:24am UTC](https://www.ruby-forum.com/t/the-fastcgi-crash-after-few-hours/55801/3 "2006-03-24T10:24:51Z")

</div>

Brian H. wrote:

> Not enough info for me to tell right off the bat, but could you please  
> paste  
> the piece of your Apache configuration for your Rails application? I’ve  
> got  
> the same configuration running for over five weeks without a problem.

The configuration in http.conf is this for my application.  
Then the application for the moment is in the development enviroment.

* * *

Alias /fatturails/ “C:/Programmi/Apache  
Group/Apache2/htdocs/fatturails/public/”

\<Directory “C:/Programmi/Apache Group/Apache2/htdocs/fatturails/public”\>  
AddHandler fastcgi-script .fcgi  
Options +ExecCGI  
AllowOverride All  
Allow from all  
Order Allow,deny

## FastCgiServer “C:/Programmi/Apache Group/Apache2/htdocs/fatturails/public/dispatch.fcgi” -processes 1

I have also found this errors in the log error of Apache. Could be this  
the reason that degrade the speed of Apache?

* * *

[Thu Mar 23 14:23:15 2006] [error] [client 192.168.0.186] FastCGI:  
server “C:/Programmi/Apache  
Group/Apache2/htdocs/fatturails/public/dispatch.fcgi” stderr:  
C:/Programmi/Apache  
Group/Apache2/htdocs/fatturails/public/…/config/…/app/controllers/invoice\_controller.rb:77:  
warning: don’t put space before argument parentheses, referer:  
[http://acserver:82/fatturails/invoice/show](http://acserver:82/fatturails/invoice/show)

## [Thu Mar 23 14:50:07 2006] [error] [client 192.168.0.186] File does not exist: C:/Programmi/Apache Group/Apache2/htdocs/images, referer: [http://acserver:82/fatturails/client](http://acserver:82/fatturails/client)

Thanks so much.  
–Andrea

---

<div class="post-metadata">

**Author:** ![reis](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/f1d935/32.png) [@reis](https://www.ruby-forum.com/u/reis)\
**Post date:** [March 24, 2006, 4:45pm UTC](https://www.ruby-forum.com/t/the-fastcgi-crash-after-few-hours/55801/4 "2006-03-24T16:45:55Z")

</div>

Sure…  
You’re not running in Production mode (at least, not according to your  
configuration file).

Try this and see if it clears matters up. fcgi does not run well in  
development mode (default unless you altered environment.rb to force  
production mode).

FastCgiServer “C:/Programmi/Apache  
Group/Apache2/htdocs/fatturails/public/dispatch.fcgi” -idle-timeout 120  
-initial-env RAILS\_ENV=production -processes 2

(make sure that’s on one line in your config file!!!)

---

<div class="post-metadata">

**Author:** ![reis](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/f1d935/32.png) [@reis](https://www.ruby-forum.com/u/reis)\
**Post date:** [March 24, 2006, 4:57pm UTC](https://www.ruby-forum.com/t/the-fastcgi-crash-after-few-hours/55801/5 "2006-03-24T16:57:08Z")

</div>

Brian H. wrote:

> Sure…  
> You’re not running in Production mode (at least, not according to your  
> configuration file).
> 
> Try this and see if it clears matters up. fcgi does not run well in  
> development mode (default unless you altered environment.rb to force  
> production mode).
> 
> FastCgiServer “C:/Programmi/Apache  
> Group/Apache2/htdocs/fatturails/public/dispatch.fcgi” -idle-timeout 120  
> -initial-env RAILS\_ENV=production -processes 2
> 
> (make sure that’s on one line in your config file!!!)

Thanks so much…  
I will try tomorrow your code.

A last question. When I change to Production mode the http.conf file, I  
must change also the inviroment in the rails application or no?

Sorry for the stupid question, but i wont try to understand if the two  
definition are independent.

–Andrea R…

---

<div class="post-metadata">

**Author:** ![reis](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/f1d935/32.png) [@reis](https://www.ruby-forum.com/u/reis)\
**Post date:** [March 24, 2006, 6:14pm UTC](https://www.ruby-forum.com/t/the-fastcgi-crash-after-few-hours/55801/6 "2006-03-24T18:14:38Z")

</div>

No you should only need to set the environment in httpd.conf.  
You WILL have to restart Apache if you want to change your models or  
controllers when you run in Production mode (but that’s usally fine…  
production mode is meant to be stable, unchaning.)

---

<div class="post-metadata">

**Author:** ![reis](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/f1d935/32.png) [@reis](https://www.ruby-forum.com/u/reis)\
**Post date:** [March 24, 2006, 6:26pm UTC](https://www.ruby-forum.com/t/the-fastcgi-crash-after-few-hours/55801/7 "2006-03-24T18:26:00Z")

</div>

Brian H. wrote:

> No you should only need to set the environment in httpd.conf.  
> You WILL have to restart Apache if you want to change your models or  
> controllers when you run in Production mode (but that’s usally fine…  
> production mode is meant to be stable, unchaning.)

Thanks so much Brian.  
–Andrea R.

---

<div class="post-metadata">

**Author:** ![reis](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/f1d935/32.png) [@reis](https://www.ruby-forum.com/u/reis)\
**Post date:** [March 25, 2006, 11:19am UTC](https://www.ruby-forum.com/t/the-fastcgi-crash-after-few-hours/55801/8 "2006-03-25T11:19:26Z")

</div>

Reis wrote:

> Brian H. wrote:
> 
> > No you should only need to set the environment in httpd.conf.  
> > You WILL have to restart Apache if you want to change your models or  
> > controllers when you run in Production mode (but that’s usally fine…  
> > production mode is meant to be stable, unchaning.)
> 
> Thanks so much Brian.  
> –Andrea R.

A last question.  
Now i use this line of code for the configuration

* * *

## FastCgiServer “C:/Programmi/Apache Group/Apache2/htdocs/fatturails/public/dispatch.fcgi” -idle-timeout 120 -initial-env RAILS\_ENV=production -processes 2

But the application reload automaticaly the changes. Is the motivation  
in the env setted as development into the rails application?

Thanks  
–Andrea R…

---

<div class="post-metadata">

**Author:** ![reis](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/f1d935/32.png) [@reis](https://www.ruby-forum.com/u/reis)\
**Post date:** [April 12, 2006, 4:04pm UTC](https://www.ruby-forum.com/t/the-fastcgi-crash-after-few-hours/55801/9 "2006-04-12T16:04:22Z")

</div>

You should be using webrick for development purposes, not FastCGI, as  
there  
are memory leaks and other problems.
