1

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!

1 Answers1

2

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

kardeiz
  • 185
  • 1
  • 1
  • 9
emills
  • 774
  • 1
  • 4
  • 15