Since I don't have access to Ruby-core, I'll just post a couple
observations here in the hope of giving someone a head start with this
problem.
I have experienced the same problem as the original poster (Hongli Lai)
i.e. a 5 second lag at start up using DRb.start_service() on Ubuntu 7 &
8 so I did a simple test this afternoon.
require 'drb'
require 'benchmark'puts Benchmark.measure { DRb.start_service() }
This consistently yielded this sort of result iteration after iteration:
0.000000 0.000000 0.000000 ( 5.020901)
This implies that the delay (5 seconds in my case) is occurring outside
of Benchmark's scope i.e. in an external service.
On a hunch, I turned off the Multicast DNS service discovery (AKA
avahi-daemon)
and re-ran the simple Benchmark.
The results are now consistently like so:
0.000000 0.000000 0.000000 ( 0.170901)
Apparently, avahi-daemon is somehow involved in the delay and review of
it's
configuration show what seem to be stub files.
Upon further investigation, the Ubuntu systems that I have that were
configured with Ubuntu-server (rather than Ubuntu-client) did not have
avahi-daemon installed and/or running and these did not experience any
start-up delay.
Briefly, DRb.start_service() and ubuntu-client systems with the
avahi-daemon appear to interact poorly. I suspect the default
configuration of the avahi-daemon but don't had the time (presently) to
investigate further.
Regards all...
···
--
Posted via http://www.ruby-forum.com/\.