# Speed up Rails and cgi script

**URL:** <https://www.ruby-forum.com/t/speed-up-rails-and-cgi-script/147882>\
**Category:** Rails\
**Created:** [September 6, 2008, 1:47pm UTC](https://www.ruby-forum.com/t/speed-up-rails-and-cgi-script/147882 "2008-09-06T13:47:03Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![konstantin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/858c86/32.png) [@konstantin](https://www.ruby-forum.com/u/konstantin)\
**Post date:** [September 6, 2008, 1:47pm UTC](https://www.ruby-forum.com/t/speed-up-rails-and-cgi-script/147882/1 "2008-09-06T13:47:03Z")

</div>

Hello!

I have a Rails application and a CGI script which uses this application  
models (api script). The application makes http requests to the api  
script and shows result.  
It works really slow… I have found some good topics about speeding up  
the Rails, but some are old, and others are about changes in the code.

Currently I’m looking for good articles about _software_ optimization,  
so I can configure my server correctly for better Rails work.  
Could you advice some?  
My configuration:  
FreeBSD 6.2  
Apache 2.2 + the latest Phusion Passenger + the latest Ruby Enterprise  
Ruby 1.8.6  
Rails 2.1.0  
the latest MySQL  
sessions in cookies

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![konstantin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/858c86/32.png) [@konstantin](https://www.ruby-forum.com/u/konstantin)\
**Post date:** [September 6, 2008, 1:53pm UTC](https://www.ruby-forum.com/t/speed-up-rails-and-cgi-script/147882/2 "2008-09-06T13:53:31Z")

</div>

On 6 Sep 2008, at 12:45, Konstantin [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Hello!
> 
> I have a Rails application and a CGI script which uses this  
> application  
> models (api script). The application makes http requests to the api  
> script and shows result.  
> That sounds a bit odd. The application is making http requests to  
> another script on the same machine? Is that other script reloading  
> rails each time it runs?

Fred

---

<div class="post-metadata">

**Author:** ![konstantin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/858c86/32.png) [@konstantin](https://www.ruby-forum.com/u/konstantin)\
**Post date:** [September 6, 2008, 2:39pm UTC](https://www.ruby-forum.com/t/speed-up-rails-and-cgi-script/147882/3 "2008-09-06T14:39:45Z")

</div>

> That sounds a bit odd. The application is making http requests to  
> another script on the same machine? Is that other script reloading  
> rails each time it runs?

Yes, currently it’s odd 🙂 Both cgi script and Rails app are on the  
same machine, and of course I can include the script without making  
http requests to it.  
But in the nearest future other applications from other sites will  
make these requests, so I need to be sure that it works fast exactly  
in this way.  
And unfortunately I see that it works very slow now… A simple page  
is loading about 60-90 seconds.

---

<div class="post-metadata">

**Author:** ![konstantin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/858c86/32.png) [@konstantin](https://www.ruby-forum.com/u/konstantin)\
**Post date:** [September 6, 2008, 10:18pm UTC](https://www.ruby-forum.com/t/speed-up-rails-and-cgi-script/147882/4 "2008-09-06T22:18:16Z")

</div>

Actually it’s just a question to all experinced Rails developers: what  
kind of configuration do you have on your production servers? Pros/  
cons of some software?  
It will be great if you can share some of your knowledge.

---

<div class="post-metadata">

**Author:** ![konstantin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/858c86/32.png) [@konstantin](https://www.ruby-forum.com/u/konstantin)\
**Post date:** [September 7, 2008, 1:29am UTC](https://www.ruby-forum.com/t/speed-up-rails-and-cgi-script/147882/5 "2008-09-07T01:29:04Z")

</div>

Let me direct your attention here:

[http://groups.google.com/group/rubyonrails-deployment](http://groups.google.com/group/rubyonrails-deployment)

😉

* * *

## seth - subimage llc

## [http://sublog.subimage.com](http://sublog.subimage.com)

## Cashboard - Estimates, invoices, and time tracking software - for free! [http://www.getcashboard.com](http://www.getcashboard.com)

Substruct - Open source RoR e-commerce software.  
[http://code.google.com/p/substruct/](http://code.google.com/p/substruct/)
