# AAF and DRb server

**URL:** <https://www.ruby-forum.com/t/aaf-and-drb-server/103092>\
**Category:** Ferret\
**Created:** [May 1, 2007, 6:45pm UTC](https://www.ruby-forum.com/t/aaf-and-drb-server/103092 "2007-05-01T18:45:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ben](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/df788c/32.png) [@ben](https://www.ruby-forum.com/u/ben)\
**Post date:** [May 1, 2007, 6:45pm UTC](https://www.ruby-forum.com/t/aaf-and-drb-server/103092/1 "2007-05-01T18:45:49Z")

</div>

I’ve installed the ferret gem. I installed AAF as a plugin into my  
vendor/plugins directory of my project. In development environment my  
searches work just fine, without any problems.

For production I configured the ferret\_server.yml file with correct  
information about the machine my DRb server is running on. I start the  
ferret server with the following command:

ruby script/runner ‘load “script/ferret\_start”’

The DRb server seems to be starting fine. I get:

Starting ferret DRb server…Done.

But when I run a top, I see that my ruby process that I started  
ferret\_server in is sitting at 95 to 99% at all times. This happens with  
no load on the server. Basically it seems that the DRb server is in some  
sort of endless loop. Any search request just blocks and doesn’t come  
back. But as soon as I kill the DRb ruby process, I get a connection  
error, which tell me that the search was waiting for the server to  
finish doing whatever it’s doing.

Even when I run the stop script, I get:

Stopping ferret\_server…  
Sending TERM to ferret\_server with PID #…Done.

But the process that started the DRb server doesn’t quit and still sits  
at 90 percentile range. I tried to look at the ferret log files  
(ferret\_server.log and ferret\_server.out and ferret\_index.log), but  
there is nothing in there. Just the creation date. I checked my  
environment.rb and I don’t have anything that recursively loads my  
modules. I let the server run overnight, thinking that it is indexing my  
DB but it still didn’t come back. With local index files and not DRb  
server, it takes ferret, at most, 15 minutes to index my DB. I can’t  
think of anything else to check or make sure of. Does anyone have any  
idea what’s going on?

Ruby 1.8.5  
Rails 1.1.6  
Ferret 0.11.4  
Latest version of AAF as of this writing.

Thanks alot.

---

<div class="post-metadata">

**Author:** ![ben](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/df788c/32.png) [@ben](https://www.ruby-forum.com/u/ben)\
**Post date:** [May 1, 2007, 7:21pm UTC](https://www.ruby-forum.com/t/aaf-and-drb-server/103092/2 "2007-05-01T19:21:30Z")

</div>

On Tue, May 01, 2007 at 06:45:49PM +0200, Ben wrote:

> The DRb server seems to be starting fine. I get:
> 
> Starting ferret DRb server…Done.
> 
> But when I run a top, I see that my ruby process that I started  
> ferret\_server in is sitting at 95 to 99% at all times. This happens with  
> no load on the server. Basically it seems that the DRb server is in some  
> sort of endless loop. Any search request just blocks and doesn’t come  
> back. But as soon as I kill the DRb ruby process, I get a connection  
> error, which tell me that the search was waiting for the server to  
> finish doing whatever it’s doing.

Recently a similar problem came up because AR models were explicitly  
required in environment.rb. Could you please try AAF trunk and start  
your server with

FERRET\_USE\_LOCAL\_INDEX=1 ruby script/runner ‘load “script/ferret\_start”’

This explicitly tells the server that it _is_ the server and therefore  
should use the local index.

Jens

–  
Jens Krämer  
webit! Gesellschaft für neue Medien mbH  
Schnorrstraße 76 | 01069 Dresden  
Telefon +49 351 46766-0 | Telefax +49 351 46766-66  
removed\_email\_address@domain.invalid | [www.webit.de](http://www.webit.de)

Amtsgericht Dresden | HRB 15422  
GF Sven Haubold, Hagen Malessa

---

<div class="post-metadata">

**Author:** ![ben](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/df788c/32.png) [@ben](https://www.ruby-forum.com/u/ben)\
**Post date:** [May 1, 2007, 7:45pm UTC](https://www.ruby-forum.com/t/aaf-and-drb-server/103092/3 "2007-05-01T19:45:15Z")

</div>

Jens K. wrote:

> Recently a similar problem came up because AR models were explicitly  
> required in environment.rb. Could you please try AAF trunk and start  
> your server with
> 
> FERRET\_USE\_LOCAL\_INDEX=1 ruby script/runner ‘load “script/ferret\_start”’
> 
> This explicitly tells the server that it _is_ the server and therefore  
> should use the local index.

That does it! It works now.

I checked my environment.rb and I couldn’t find any statements that  
required any of my models. I don’t know what was happening before. I  
guess the trunk code has some fixes and tweaks, being the latest  
development snapshot.

Thanks for your quick response and great job on the AAF plugin. This is  
how good written code should be, simple and functional.

Thanks,  
Ben
