Return-Path: Delivered-To: apmail-directory-dev-archive@www.apache.org Received: (qmail 93646 invoked from network); 11 Nov 2005 14:40:33 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 11 Nov 2005 14:40:33 -0000 Received: (qmail 57661 invoked by uid 500); 11 Nov 2005 14:40:32 -0000 Delivered-To: apmail-directory-dev-archive@directory.apache.org Received: (qmail 56738 invoked by uid 500); 11 Nov 2005 14:40:28 -0000 Mailing-List: contact dev-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Apache Directory Developers List" Delivered-To: mailing list dev@directory.apache.org Received: (qmail 56725 invoked by uid 99); 11 Nov 2005 14:40:28 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [192.87.106.226] (HELO ajax.apache.org) (192.87.106.226) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 11 Nov 2005 06:40:26 -0800 Received: from ajax.apache.org (ajax.apache.org [127.0.0.1]) by ajax.apache.org (Postfix) with ESMTP id C62D7E1 for ; Fri, 11 Nov 2005 15:40:05 +0100 (CET) Message-ID: <667974641.1131720005809.JavaMail.jira@ajax.apache.org> Date: Fri, 11 Nov 2005 15:40:05 +0100 (CET) From: "dave irving (JIRA)" To: dev@directory.apache.org Subject: [jira] Commented: (DIRMINA-119) Multiple selector loops In-Reply-To: <958001931.1131529340117.JavaMail.jira@ajax.apache.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N [ http://issues.apache.org/jira/browse/DIRMINA-119?page=comments#action_12357389 ] dave irving commented on DIRMINA-119: ------------------------------------- Hi, I've been out of the office for a couple of days, and have a few meetings this afternoon. However, I'll try and take a look over the weekend, or maybe early next week - and I'll post a patch to this issue as soon as I can. Thanks, Dave > Multiple selector loops > ----------------------- > > Key: DIRMINA-119 > URL: http://issues.apache.org/jira/browse/DIRMINA-119 > Project: Directory MINA > Type: Improvement > Versions: 0.9 > Environment: All. Benefit is dependant on environment > Reporter: dave irving > Assignee: Trustin Lee > Priority: Minor > Attachments: prototype.zip > > Mina's SocketIoProcessor currently owns a Selector and employs a single Worker to run the NIO "selector loop". > I have been running tests where Im trying to maximise throughput and have found - that in certain multi-cpu environments - this worker thread can encounter a large amount of starvation even though CPU usage is fairly low. > By testing 2 selector-loops instead of 1, I managed to improve my overall test throughput by just under 30%. > The general idea is to do this: > - Each SocketIoProcessor.Worker encapsulates its own work queues associated Selector > - It should be possible to configure the number of Workers (and thus selectors) employed by SocketIoProcessor > - When a SocketSession is added to the SocketIoProcessor, a Worker is selected (round-robin) which will be associated with the SocketSession for its lifetime. This association is managed by SocketSession (get/setWorker) > - When someone asks SocketIoProcessor to do some work to a session, instead of doing it directly, the processor now asks the session for its Worker, and delegates to the worker (i.e, the same worker is always used for an individual session) > I've done some prototyping, and have also checked that the concept works with the latest build. > The prototype is very hacky - mainly because there are some refactoring issues i'd like feed-back on before I submit a "proper" patch for review. Namely: > - How do you want me to tell the SocketIoProcessor how many workers to use? One option is a system property - but thats pretty hacky. I dont think we need to support changing the number of workers after operation has begun (It'll probably be a function of the number of available CPUs) - and this makes the code simpler. However, as SocketIoProcessor is a (non lazy created) singleton, we need a way to get the param in. We could refactor, or maybe introduce a ProcessorOptions class or something. The SocketIoProcessor could interrigate this when initializing. Any direction on your desired approach would be appreciated > Cheers, > Dave -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira