Previous Next

Thread: Getting Ruby to stay in memory under fastcgi.

Last post 03-14-2007 8:38 PM by wadeh. 3 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (4 items)

Sort Posts:

  • 03-13-2007, 6:27 PM

    • Stoo
    • Not Ranked
    • Joined on 03-13-2007, 10:17 PM
    • Posts 3

    Getting Ruby to stay in memory under fastcgi.

    First up, let me just say that this FastCGI for IIS has solved many stability issues that we had with older fastcgi products.

     

    We do have one last issue to resolve however. We run Ruby on Rails under FastCGI on IIS6.0 (2k3SP1). We also run Postgres on these servers, but nothing else.

    When we make our first request to the server, it takes a few seconds for the Rubyw.exe to start up and compile our code. Once it is started, everything appears to be fairly snappy and generally runs well. Our problem is that after around 5 minutes of being idle, the rubyw.exe process terminates. Another one will start as soon as a request is made, but this makes for a fairly slow browsing experience for our users as they often have to wait for the ruby app to "spin up".

     

    Is there a way to keep these ruby processes running in memory for a lot longer? I've tried tweaking the "InstanceTimeout" value in fcgiext.ini, but this appears to have no effect whatsoever, and the processes still seem to terminate after about 5 minutes.

     

    Any help, or clues that may lead me in the right direction are muchly appreciated! We've solved so many other problems along the way that we've had, this seems to be the last little hurdle to using this solution in production!

     

    Stoo


     

  • 03-14-2007, 2:27 PM In reply to

    • wadeh
    • Top 50 Contributor
    • Joined on 04-19-2005, 10:17 PM
    • Posts 97

    Re: Getting Ruby to stay in memory under fastcgi.

    Hi Stoo,

    The name of the setting is IdleTimeout.  It defaults to 300 seconds, which explains the 5 minutes.

    I assume that the reason you are not seeing results is that you've used an incorrect property name.  Also, the setting only takes effect when the worker process starts up, so you either need to recycle the app pool or the web service when you make a change to fcgiext.ini.

    I hope that this helps,

    -Wade

  • 03-14-2007, 3:46 PM In reply to

    • Stoo
    • Not Ranked
    • Joined on 03-13-2007, 10:17 PM
    • Posts 3

    Re: Getting Ruby to stay in memory under fastcgi.

    Aha! Thanks for that. I was using the settings in the initial setup doc that I found on this site somewhere. For my part, I'm now feeling slightly sheepish, as just this morning I have had another search through this site and found more fcgiext.ini settings. Had I looked a bit harder to begin with, i wouldn't have had to post!

     

    Thanks again,

     

    Stoo

     


  • 03-14-2007, 8:38 PM In reply to

    • wadeh
    • Top 50 Contributor
    • Joined on 04-19-2005, 10:17 PM
    • Posts 97

    Re: Getting Ruby to stay in memory under fastcgi.

    No problem.  The ini settings have been a bit of a moving target between the two tech preview releases.

    If it helps, I wrote a blog on just this topic a while ago.  These should be the canonical settings, at least until the next release (where we've added at least one so far):

    http://blogs.iis.net/wadeh/archive/2007/03/02/first-post-fastcgi-settings-for-iis-5-1-6.aspx

    Thanks,

    -Wade

Page 1 of 1 (4 items)
Page view counter