# Help with Apache and Production

**URL:** <https://www.ruby-forum.com/t/help-with-apache-and-production/135598>\
**Category:** Rails\
**Created:** [April 23, 2008, 2:20pm UTC](https://www.ruby-forum.com/t/help-with-apache-and-production/135598 "2008-04-23T14:20:30Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![captaffy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/f04885/32.png) [@captaffy](https://www.ruby-forum.com/u/captaffy)\
**Post date:** [April 23, 2008, 2:20pm UTC](https://www.ruby-forum.com/t/help-with-apache-and-production/135598/1 "2008-04-23T14:20:30Z")

</div>

I have my Rails app in an Apache server. If i don’t use this app for a  
while it goes very slow the first clic. After this first clic, it goes  
very fast. I want the first response to be fast too.  
My production.rb file is:

# Settings specified here will take precedence over those in

config/environment.rb

# In the development environment your application’s code is reloaded on

# every request. This slows down response time but is perfect for

development

# since you don’t have to restart the webserver when you make code

changes.  
config.cache\_classes = false

# Log error messages when you accidentally call methods on nil.

config.whiny\_nils = true

# Show full error reports and disable caching

config.action\_controller.consider\_all\_requests\_local = true  
config.action\_view.debug\_rjs = true  
config.action\_controller.perform\_caching = false  
config.action\_view.cache\_template\_extensions = false

# Don’t care if the mailer can’t send

config.action\_mailer.raise\_delivery\_errors = true

# set delivery method to :smtp, :sendmail or :test

config.action\_mailer.delivery\_method = :activerecord

# these options are only needed if you choose smtp delivery

config.action\_mailer.smtp\_settings = {  
:address =\> “…”,  
:port =\> 25,  
:domain =\> ‘…’,  
:authentication =\> :login,  
:user\_name =\> “…”,  
:password =\> ‘…’  
}

---

<div class="post-metadata">

**Author:** ![captaffy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/f04885/32.png) [@captaffy](https://www.ruby-forum.com/u/captaffy)\
**Post date:** [April 23, 2008, 2:30pm UTC](https://www.ruby-forum.com/t/help-with-apache-and-production/135598/2 "2008-04-23T14:30:08Z")

</div>

On 23 Apr 2008, at 13:20, John S. wrote:

> I have my Rails app in an Apache server. If i don’t use this app for a  
> while it goes very slow the first clic. After this first clic, it goes  
> very fast. I want the first response to be fast too.  
> My production.rb file is:

If you’re using fastcgi then it’s probably your fastcgi listeners  
getting killed off. You can probably tweak this in your apache config  
but it’s been so long since i’ve used fastcgi that I don’t recall how.

Fred

---

<div class="post-metadata">

**Author:** ![captaffy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/f04885/32.png) [@captaffy](https://www.ruby-forum.com/u/captaffy)\
**Post date:** [April 24, 2008, 12:57pm UTC](https://www.ruby-forum.com/t/help-with-apache-and-production/135598/3 "2008-04-24T12:57:09Z")

</div>

Any idea?

---

<div class="post-metadata">

**Author:** ![captaffy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/f04885/32.png) [@captaffy](https://www.ruby-forum.com/u/captaffy)\
**Post date:** [April 24, 2008, 4:07pm UTC](https://www.ruby-forum.com/t/help-with-apache-and-production/135598/4 "2008-04-24T16:07:59Z")

</div>

For me, I have the following in my apache’s httpd.conf file:

# FastCGI
 FastCgiIpcDir /tmp/fcgi\_ipc FastCgiConfig -initial-env RAILS\_ENV=production FastCgiServer /home/client/current/public/dispatch.fcgi -initial-env RAILS\_ENV=production -processes 1 -idle-timeout 60 FastCgiServer /home/client2/current/public/dispatch.fcgi -initial- env RAILS\_ENV=production -processes 2 -idle-timeout 60 FastCgiServer /home/client3/clientapp/public/dispatch.fcgi -initial- env RAILS\_ENV=production -processes 2 -idle-timeout 60

This makes 'em permanent processes.

HTH!

-Danimal

On Apr 24, 4:57 am, John S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
