Q: Slow performance on TextDrive

Hi,

I just set up rails app on TextDrive via lighttpd + mongrel.
I followed their
instruction(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

Always or just the first time?

Steve Ross wrote:

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

Hi Steve,

Steve Ross 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

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

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.