# Q: Slow performance on TextDrive

**URL:** <https://www.ruby-forum.com/t/q-slow-performance-on-textdrive/124825>\
**Category:** Rails\
**Created:** [January 2, 2008, 10:22pm UTC](https://www.ruby-forum.com/t/q-slow-performance-on-textdrive/124825 "2008-01-02T22:22:57Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ssk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/82dd89/32.png) [@ssk](https://www.ruby-forum.com/u/ssk)\
**Post date:** [January 2, 2008, 10:22pm UTC](https://www.ruby-forum.com/t/q-slow-performance-on-textdrive/124825/1 "2008-01-02T22:22:57Z")

</div>

Hi,

I just set up rails app on TextDrive via lighttpd + mongrel.  
I followed their  
instruction([Joyent Ticketing System](https://help.joyent.com/index.php?pg=kb.page&id=250)) and it  
runs fine.

However, a simple action takes long time (about 5 seconds).  
It takes about same time when refreshed.

It’s a simple action like the following.

def say  
render :text =\> ‘Hello’  
end

It’s on production environment.  
The log doesn’t show any error and it says like this.  
Completed in 0.00101 (988 reqs/sec)

Then, where is most of the time wasted?  
More importantly, how can I track it down?

Thank you.

Sam

---

<div class="post-metadata">

**Author:** ![ssk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/82dd89/32.png) [@ssk](https://www.ruby-forum.com/u/ssk)\
**Post date:** [January 2, 2008, 10:27pm UTC](https://www.ruby-forum.com/t/q-slow-performance-on-textdrive/124825/2 "2008-01-02T22:27:13Z")

</div>

On Jan 2, 2008, at 1:22 PM, Sam K. wrote:

> However, a simple action takes long time (about 5 seconds).  
> It takes about same time when refreshed.

Always or just the first time?

---

<div class="post-metadata">

**Author:** ![ssk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/82dd89/32.png) [@ssk](https://www.ruby-forum.com/u/ssk)\
**Post date:** [January 2, 2008, 10:28pm UTC](https://www.ruby-forum.com/t/q-slow-performance-on-textdrive/124825/3 "2008-01-02T22:28:05Z")

</div>

Steve R. wrote:

> On Jan 2, 2008, at 1:22 PM, Sam K. wrote:
> 
> > However, a simple action takes long time (about 5 seconds).  
> > It takes about same time when refreshed.
> 
> Always or just the first time?

Always.

Sam

---

<div class="post-metadata">

**Author:** ![ssk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/82dd89/32.png) [@ssk](https://www.ruby-forum.com/u/ssk)\
**Post date:** [January 2, 2008, 10:33pm UTC](https://www.ruby-forum.com/t/q-slow-performance-on-textdrive/124825/4 "2008-01-02T22:33:58Z")

</div>

Hi Steve,

Steve R. wrote:

> It sounds like how Rails performs under CGI. Can you go directly to  
> the port mongrel is listening on and compare?

When I requested directly to the mongrel port, it took less than 1 sec.  
The first time took about 3 seconds but later ones responded instantly.

How can I fix that?

Sam

---

<div class="post-metadata">

**Author:** ![ssk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/82dd89/32.png) [@ssk](https://www.ruby-forum.com/u/ssk)\
**Post date:** [January 2, 2008, 10:30pm UTC](https://www.ruby-forum.com/t/q-slow-performance-on-textdrive/124825/5 "2008-01-02T22:30:44Z")

</div>

It sounds like how Rails performs under CGI. Can you go directly to  
the port mongrel is listening on and compare?

---

<div class="post-metadata">

**Author:** ![ssk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/82dd89/32.png) [@ssk](https://www.ruby-forum.com/u/ssk)\
**Post date:** [January 2, 2008, 10:46pm UTC](https://www.ruby-forum.com/t/q-slow-performance-on-textdrive/124825/6 "2008-01-02T22:46:32Z")

</div>

I don’t use TextDrive, but perhaps this article will help you:

[http://wiki.joyent.com/shared:kb:rails-with-mongrel](http://wiki.joyent.com/shared:kb:rails-with-mongrel)

You’re currently running your Rails app through CGI. The mongrel  
instance is untouched when you make a request through their Apache  
server. A brand new instance of Ruby, Rails, and your app are loaded  
up for each request (ugggh) because Apache doesn’t know anything about  
how it’s supposed to proxy the requests. It’s really easy to proxy  
from Apache directly to mongrel.
