By default, all requests coming from localhost will be run as [[CGI]]. This is great for development since the entire application will be reloaded every time, so any change is instant. It's unusable for production, though, as each CGI request needs to establish a new interpreter and initialize all of Rails, which is pretty slow.
So you have two choices for production environments:
* FastCGI: The preferred and default method
* [[mod_ruby]]: Also possible...
Have a look in @config/httpd.conf@ to see how Rails route the different requests coming in to the different environments.
If you're building a web-app that has some heavy-duty pages, or in general gets a good hammering, check out "mod_cache for Apache.":http://httpd.apache.org/docs-2.0/mod/mod_cache.html It has file-based and memory-based caching with configurable timeouts. Naturally caching should be used with caution, and beware of caching personalized content.
Q: What about using rails' own "caching implementation":http://rails.rubyonrails.com/classes/ActionController/Caching.html ? -- ScottMaclure
A: Rails' caching is fast and stable, and unlike mod_cache, can be applied granularly, allowing personalized content on the same page as cached content.  Rails' caching can also be used with servers other than [[Apache]], including [[WEBrick]] and [[Lighttpd]].  "mod_cache":http://httpd.apache.org/docs-2.0/mod/mod_cache.html and Rails' caching are complementary technologies, and can be used in tandem.
Q: What about [[WEBrick]]?  Is it good for production?
A: [[WEBrick]] is not seen as being ideal for general production use. That being said, depending on the scale of your use, [[WEBrick]] may be an ideal solution. The thread "webrick in production use?":http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/133166 from ruby-talk might be of interest.
Q: "My Web host":http://www.nearlyfreespeech.net/ won't install FastCGI or [[mod_ruby]], calling the former too resource-intensive and the latter insecure. Rails seems pretty slow without any help. Is there anything else I/they can do for speed?
A: Yes. Change your provider.
