You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by "Emmanuel Lecharny (JIRA)" <ji...@apache.org> on 2009/03/09 00:51:56 UTC

[jira] Created: (DIRMINA-668) Modify the way we use IoProcessors

Modify the way we use IoProcessors
----------------------------------

                 Key: DIRMINA-668
                 URL: https://issues.apache.org/jira/browse/DIRMINA-668
             Project: MINA
          Issue Type: Improvement
    Affects Versions: 2.0.0-M4
            Reporter: Emmanuel Lecharny
             Fix For: 3.0.0-M1


In the current code base, when accepting new connections, we pick a processor and register the news connection within the internal selector. In other words, we have as many selectors as we have IoProcessors.

This is a potential problem if some request cost a lot to be executed, as every requests waiting on this IoProcessor will be blocked.

It would be way better to use a single selector which dispatches requests to an Executor, as we will always have available threads ready to process the requests (unless the pool is saturated, but then we have a bigger issue ...)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Issue Comment Edited: (DIRMINA-668) Modify the way we use IoProcessors

Posted by "chuanwen chen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DIRMINA-668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12785820#action_12785820 ] 

chuanwen chen edited comment on DIRMINA-668 at 12/4/09 8:43 AM:
----------------------------------------------------------------

Not sure where requests will be blocked, or will you explain "cost a lot"?

      was (Author: cfsego):
    Not sure where requests will be blocked, or will you explain "cost lots"?
  
> Modify the way we use IoProcessors
> ----------------------------------
>
>                 Key: DIRMINA-668
>                 URL: https://issues.apache.org/jira/browse/DIRMINA-668
>             Project: MINA
>          Issue Type: Improvement
>    Affects Versions: 2.0.0-M4
>            Reporter: Emmanuel Lecharny
>             Fix For: 3.0.0-M1
>
>
> In the current code base, when accepting new connections, we pick a processor and register the news connection within the internal selector. In other words, we have as many selectors as we have IoProcessors.
> This is a potential problem if some request cost a lot to be executed, as every requests waiting on this IoProcessor will be blocked.
> It would be way better to use a single selector which dispatches requests to an Executor, as we will always have available threads ready to process the requests (unless the pool is saturated, but then we have a bigger issue ...)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DIRMINA-668) Modify the way we use IoProcessors

Posted by "chuanwen chen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DIRMINA-668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12786759#action_12786759 ] 

chuanwen chen commented on DIRMINA-668:
---------------------------------------

I followed the execution flows of SocketAccept and SocketConnect, IoProcessors do not process any handler in their own threads, but throw them to org.apache.mina.filter.executor.ExecutorFilter, moreover, the filter process the user handlers within a threadpool(about 16 threads). So I don't think every requests waiting on this IoProcessor will be blocked, but fail.

> Modify the way we use IoProcessors
> ----------------------------------
>
>                 Key: DIRMINA-668
>                 URL: https://issues.apache.org/jira/browse/DIRMINA-668
>             Project: MINA
>          Issue Type: Improvement
>    Affects Versions: 2.0.0-M4
>            Reporter: Emmanuel Lecharny
>             Fix For: 3.0.0-M1
>
>
> In the current code base, when accepting new connections, we pick a processor and register the news connection within the internal selector. In other words, we have as many selectors as we have IoProcessors.
> This is a potential problem if some request cost a lot to be executed, as every requests waiting on this IoProcessor will be blocked.
> It would be way better to use a single selector which dispatches requests to an Executor, as we will always have available threads ready to process the requests (unless the pool is saturated, but then we have a bigger issue ...)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DIRMINA-668) Modify the way we use IoProcessors

Posted by "chuanwen chen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DIRMINA-668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12785820#action_12785820 ] 

chuanwen chen commented on DIRMINA-668:
---------------------------------------

Not sure where requests will be blocked.

> Modify the way we use IoProcessors
> ----------------------------------
>
>                 Key: DIRMINA-668
>                 URL: https://issues.apache.org/jira/browse/DIRMINA-668
>             Project: MINA
>          Issue Type: Improvement
>    Affects Versions: 2.0.0-M4
>            Reporter: Emmanuel Lecharny
>             Fix For: 3.0.0-M1
>
>
> In the current code base, when accepting new connections, we pick a processor and register the news connection within the internal selector. In other words, we have as many selectors as we have IoProcessors.
> This is a potential problem if some request cost a lot to be executed, as every requests waiting on this IoProcessor will be blocked.
> It would be way better to use a single selector which dispatches requests to an Executor, as we will always have available threads ready to process the requests (unless the pool is saturated, but then we have a bigger issue ...)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DIRMINA-668) Modify the way we use IoProcessors

Posted by "chuanwen chen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DIRMINA-668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12787249#action_12787249 ] 

chuanwen chen commented on DIRMINA-668:
---------------------------------------

Sorry, my mistake, it is 1.x in my hand

> Modify the way we use IoProcessors
> ----------------------------------
>
>                 Key: DIRMINA-668
>                 URL: https://issues.apache.org/jira/browse/DIRMINA-668
>             Project: MINA
>          Issue Type: Improvement
>    Affects Versions: 2.0.0-M4
>            Reporter: Emmanuel Lecharny
>             Fix For: 3.0.0-M1
>
>
> In the current code base, when accepting new connections, we pick a processor and register the news connection within the internal selector. In other words, we have as many selectors as we have IoProcessors.
> This is a potential problem if some request cost a lot to be executed, as every requests waiting on this IoProcessor will be blocked.
> It would be way better to use a single selector which dispatches requests to an Executor, as we will always have available threads ready to process the requests (unless the pool is saturated, but then we have a bigger issue ...)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Issue Comment Edited: (DIRMINA-668) Modify the way we use IoProcessors

Posted by "chuanwen chen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DIRMINA-668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12785820#action_12785820 ] 

chuanwen chen edited comment on DIRMINA-668 at 12/4/09 8:43 AM:
----------------------------------------------------------------

Not sure where requests will be blocked, or will you explain "cost lots"?

      was (Author: cfsego):
    Not sure where requests will be blocked.
  
> Modify the way we use IoProcessors
> ----------------------------------
>
>                 Key: DIRMINA-668
>                 URL: https://issues.apache.org/jira/browse/DIRMINA-668
>             Project: MINA
>          Issue Type: Improvement
>    Affects Versions: 2.0.0-M4
>            Reporter: Emmanuel Lecharny
>             Fix For: 3.0.0-M1
>
>
> In the current code base, when accepting new connections, we pick a processor and register the news connection within the internal selector. In other words, we have as many selectors as we have IoProcessors.
> This is a potential problem if some request cost a lot to be executed, as every requests waiting on this IoProcessor will be blocked.
> It would be way better to use a single selector which dispatches requests to an Executor, as we will always have available threads ready to process the requests (unless the pool is saturated, but then we have a bigger issue ...)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DIRMINA-668) Modify the way we use IoProcessors

Posted by "Emmanuel Lecharny (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DIRMINA-668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12786979#action_12786979 ] 

Emmanuel Lecharny commented on DIRMINA-668:
-------------------------------------------

The IoProcessor class inherits from the AbstractPollingIoProcessor class, which contains an inner class named Processor, which is responsible for handling incoming messages. This class implements Runnable, and call the process() method, which iterates on all the selected sessions, one by one, do a read() for each one of them, and call the filterChain.fireMessageReceived(buf) method if some data has been received. If yiu don't put an executor in your chain, and if this chain processing is costly, then the whole mchansim will wait until your costly handling is finished.

> Modify the way we use IoProcessors
> ----------------------------------
>
>                 Key: DIRMINA-668
>                 URL: https://issues.apache.org/jira/browse/DIRMINA-668
>             Project: MINA
>          Issue Type: Improvement
>    Affects Versions: 2.0.0-M4
>            Reporter: Emmanuel Lecharny
>             Fix For: 3.0.0-M1
>
>
> In the current code base, when accepting new connections, we pick a processor and register the news connection within the internal selector. In other words, we have as many selectors as we have IoProcessors.
> This is a potential problem if some request cost a lot to be executed, as every requests waiting on this IoProcessor will be blocked.
> It would be way better to use a single selector which dispatches requests to an Executor, as we will always have available threads ready to process the requests (unless the pool is saturated, but then we have a bigger issue ...)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DIRMINA-668) Modify the way we use IoProcessors

Posted by "Emmanuel Lecharny (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DIRMINA-668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12785852#action_12785852 ] 

Emmanuel Lecharny commented on DIRMINA-668:
-------------------------------------------

AFAIR, when a new message arrives, as it is associated with a session, it's beng processed by a IoProcessor. As an IoProcessor also holds the selector, we can't process more than one message at a time in a single IoProcessor (hopefully, we have more than one IoProcessor). So if the message is costly to process (ie, yu access a database in the middle), in a loaded system, messages can be blocked a long time before being processed, waiing for the crrent message to be completed.

This is what I meant. Hope it's clearer.

> Modify the way we use IoProcessors
> ----------------------------------
>
>                 Key: DIRMINA-668
>                 URL: https://issues.apache.org/jira/browse/DIRMINA-668
>             Project: MINA
>          Issue Type: Improvement
>    Affects Versions: 2.0.0-M4
>            Reporter: Emmanuel Lecharny
>             Fix For: 3.0.0-M1
>
>
> In the current code base, when accepting new connections, we pick a processor and register the news connection within the internal selector. In other words, we have as many selectors as we have IoProcessors.
> This is a potential problem if some request cost a lot to be executed, as every requests waiting on this IoProcessor will be blocked.
> It would be way better to use a single selector which dispatches requests to an Executor, as we will always have available threads ready to process the requests (unless the pool is saturated, but then we have a bigger issue ...)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.