You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by "Maria Petridean (JIRA)" <ji...@apache.org> on 2016/07/06 11:42:10 UTC

[jira] [Updated] (DIRMINA-1039) Response messages queue up on the server side waiting to be written to socket, while the server continues to read more request messages, causing out of heap memory

     [ https://issues.apache.org/jira/browse/DIRMINA-1039?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Maria Petridean updated DIRMINA-1039:
-------------------------------------
    Description: 
One case in which this bug reproduces is by using a client which generates a heavy request-load. The mina thread which processes both reads and writes - exits the write cycle after processing every empty marker (the WriteRequest which wraps an empty buffer, acting as a message marker). This will result in the thread resuming the read cycle, hence reading more client request messages. After a few minutes, the number of read messages is much larger than the number of written response messages, even though the responses are waiting in the queue, ready to be written to socket.

To solve this, the sever shouldn't exit the write cycle after processing every marker WriteRequest. This way the ratio between the read and written messages will be more balanced; this will avoid the heap memory getting full and causing server degradation.

Also, an improvement can be considered here to avoid using the same single thread for both reads and writes.

  was:
One case in which this bug reproduces is by using a client which generates a heavy request-load. The mina thread which processes both reads and writes - exits the write cycle after processing every empty marker (the WriteRequest which wraps an empty buffer, acting as a message marker). This will result in the thread resuming the read cycle, hence reading more client request messages. After a few minutes, the number of read messages is much larger than the number of written response messages, even though the responses are waiting in the queue, ready to be written to socket.

To solve this, the sever shouldn't exit the write cycle after processing every marker WriteRequest. This way the ratio between the read and written messages will be much more balanced; this will avoid the heap memory getting full and causing server degradation.

Also, an improvement can be considered here to avoid using the same single thread for both reads and writes.


> Response messages queue up on the server side waiting to be written to socket, while the server continues to read more request messages, causing out of heap memory
> -------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: DIRMINA-1039
>                 URL: https://issues.apache.org/jira/browse/DIRMINA-1039
>             Project: MINA
>          Issue Type: Bug
>          Components: Core
>            Reporter: Maria Petridean
>   Original Estimate: 2h
>  Remaining Estimate: 2h
>
> One case in which this bug reproduces is by using a client which generates a heavy request-load. The mina thread which processes both reads and writes - exits the write cycle after processing every empty marker (the WriteRequest which wraps an empty buffer, acting as a message marker). This will result in the thread resuming the read cycle, hence reading more client request messages. After a few minutes, the number of read messages is much larger than the number of written response messages, even though the responses are waiting in the queue, ready to be written to socket.
> To solve this, the sever shouldn't exit the write cycle after processing every marker WriteRequest. This way the ratio between the read and written messages will be more balanced; this will avoid the heap memory getting full and causing server degradation.
> Also, an improvement can be considered here to avoid using the same single thread for both reads and writes.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)