Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm completely new in Rails and I'm facing this problem:

My application runs fine on my development machine when I use script/server (called webrick I guess)

The problem is when I put the application online with mod_rails. It takes forever to start after being idle for a while and in general it feels slower.

I was told to do this on my apache file:

<VirtualHost *:80>
    ServerName server.com
    DocumentRoot /var/www/server.com/public
    PassengerPoolIdleTime 99999
</VirtualHost>

The problem is I don't find this very elegant and if I don't use my app after a while it does the bootup thing again.

Thanks!

share|improve this question

1 Answer 1

If this server has a decent amount of resources you should consider leaving the passenger processes running constantly. You can do this by setting the timeouts on a few things to 0.

PassengerPoolIdleTime 0
RailsFrameworkSpawnerIdleTime 0
RailsAppSpawnerIdleTime 0

Also setting more running ruby instances may help with possible load issues

PassengerMaxPoolSize 8

You can find full details on all of the possible apache passenger configuration parameters at the link below. In particular, take a look at PassengerHighPerformance and see if it applies to you. Also take a look at the three different rails spawn methods explained near the bottom. Depending on your application, you may be able to get a decent speed increase by using one of the faster spawners.

http://www.modrails.com/documentation/Users%20guide.html

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.