Performance profiling & routes

Hi all,

With a rails app running under lighttpd, we’ve recently stopped using
lighttpd’s URL rewriting in favour of letting Rails’ routes do their
job.

However, under proper testing, we now see the application slowing down
after
a period of time (a couple of days); pages take increasingly longer to
load
over time. This is fixed by a lighttpd restart.

Could this performance degredation have anything to do with the use of
the
routes (we’re just using the default set)? If not, can anyone offer any
pointers about good ways to track down performance issues in a Rails
app?

Please let me know if you need any more info.

Thanks much for your help,

  • Tim

How is the machine’s health when the application slows down?

I don’t have extensive experience with production Rails apps, but
there seems to be a clear pattern of ever increasing memory usage
causing machines to being swapping.

There are some good emails in the archive about how to force
Ruby garbage collection. Perhaps you should incorporate forced
collection into your application…


– Tom M.

Also make certain that you are running in production and not
development mode(i’m sure you did this already). Also what kind of
rails app is it? Does it use RMagick at all? Other extensions?

I don't think that routes are causing the problem especially if you

are just using the defaults. I have rails apps running on lighttpd/
fcgi for months without reboots that are stable in their memory
consumption. But I have other apps that use RMagick heavily that
would steadily increase in memory usage.

With a little more info I might be able to help more? Does the app

just get slower or does the memory usage grow? Also have you
benchmarked the app after a restart and then when it gets slow?
Sometime perceptions can be wrong. Also, what amount of traffic does
the site get? Rails apps that run on fcgi and end up stiing idle for
hours ata time can be slow to start again because the fcgi processes
get paged out of memory. If this is the case I have solved it by
using wget and a cron job to hit the site every 5 minutes to keep the
fcgi’s warmed up.

Cheers-
-Ezra

On Feb 8, 2006, at 10:13 PM, Tom M. wrote:

Please let me know if you need any more info.
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails

-Ezra Z.
Yakima Herald-Republic
WebMaster

509-577-7732
[email protected]