[
https://issues.apache.org/jira/browse/DIRMINA-1152?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17452808#comment-17452808
]
Dmitrii Novikov commented on DIRMINA-1152:
------------------------------------------
Hi [~johnnyv],
Could you please review PR: https://github.com/apache/mina/pull/30
> IoServiceStatistics introduces huge latencies
> ---------------------------------------------
>
> Key: DIRMINA-1152
> URL: https://issues.apache.org/jira/browse/DIRMINA-1152
> Project: MINA
> Issue Type: Bug
> Components: Core
> Affects Versions: 2.1.4, 2.1.5
> Reporter: Dmitrii Novikov
> Priority: Major
> Time Spent: 10m
> Remaining Estimate: 0h
>
> Current implementation of IoServiceStatistics is blocking - it blocks on
> _throughputCalculationLock_ for almost all operations
> However, _IoServiceStatistics_ is used by all threads which writes to
> _IoSession_ and by all _NioProcessor_ threads.
> Blocking _IoServiceStatistics_ dramatically decreases performance in case of
> multithreaded writing to {_}IoSession{_}.
> Please, refer to my
> [benchmark|https://github.com/dmitriinovikov/apache-mina-benchmark] to ensure
> that it is so. The measurements are taken between the time the message was
> written to _IoSession_ by client and the time when it was actually sent to
> the server by _NioProcessor._ Latency percentiles are calculated for all
> messages except the first 20% - consider it as a warmup. You can read about
> benchmark details in the README file.
>
> My benchmark results:
> {code:java}
> # non-blocking IoServiceStatistics vs blocking IoServiceStatistics:
> p50: 85mcs vs 140mcs
> p75: 150mcs vs 400mcs
> p90: 239mcs vs 905mcs
> p95: 319mcs vs 1418mcs
> p99: 1311mcs vs 11485mcs {code}
>
> As a simple workaround solution, I would suggest to add an option to disable
> _IoServiceStatistics_ or replace it with custom implementation.
--
This message was sent by Atlassian Jira
(v8.20.1#820001)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]