Rails - DH vs. Acts_As_Ferret

software development



I’ve been redirected here by DH customer support.
My Rails app is using acts_as_ferret, which is now de facto standard for implementing full-text search in rails. The thing is, for AAF to work smoothly and without “corrupt index error” in production environment, where multiple processes are serving clients requests, it should be handled by own Drb server.

Unfortunately, running any sort of server (anything that binds to a port) is against DH policy.

So, there’s my problem:
Now a question arises - how can my website benefit from using acts_as_ferret? I can, of course, make my site run without this AAF Drb server, which runs very well UNLESS it’s search capability is executed by multiple processes. Like, for example, multiple dispatch.fcgi processes. Thus I’d like to ask You a few questions:

  1. When my RoR e-store is (will be) facing a high load, will more than one dispatch.fcgi process be launched to process all the requests?

  2. If answer to above is “yes”, can I - and if, how - limit amount of running dispatch.fcgi processes to only one? I’m willing to sacrifice some speed of my site for sake of having it running without errors.

Or, maybe You have any rails app running on DH account that use acts_as_ferret and don’t have any problems with rolling without drb server, with :remote=>false set in model’s aaf configuration line?


I’m wanting to add acts_as_ferret to my app as well, and came across the discussion of DRb. I have not tried this, but wouldn’t it be possible to make the search index read-only from the app, and have another piece of code in a cron job that updates the index? You don’t get realtime indexing, but it might be fine for some applications.


OK, I managed to get this idea working on my Dreamhost Rails app: