You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@nutch.apache.org by Paul Baclace <pe...@baclace.net> on 2005/10/19 07:59:35 UTC

Re: Event queues vs threads

Doug Cutting wrote:
 >Kelvin Tan wrote:
>> fetcher as a series of event queues (ala SEDA) instead 
>> of with threads.
> 
> I have never been able to write a async version of things with Java's 
> nio that outperforms a threaded version.  In theory it is possible, 
> since you can avoid thread switching overheads.  But in practice I have 
> found it difficult.

I read the David Culler, et al SEDA paper a while back and I think
the real benefit is twofold:  (1) more concurrent connectionsand
(2) graceful degradation (meaning fair scheduling) at maximum load.
IIRC, they hint at competitive-with-apache web serving, but this
depends on specific mix of requests/file sizes, etc.; Tomcat can
also beat the apache web server under some conditions.

Services that need to maintain lots of mostly-idle connections
(like instant messaging) benefit the most from a SEDA architecture.

It should be possible to have graceful degradation with a
thread-oriented architecture.  Perhaps a self-tuning procedure
that, for a specific installation, could discover the parameter
settings to get the most out of a server and have it refuse requests
that would push it into the unfair scheduling zone.

Paul