Details
Description
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 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:
# 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
As a simple workaround solution, I would suggest to add an option to disable IoServiceStatistics or replace it with custom implementation.
Attachments
Issue Links
- relates to
-
DIRMINA-629 The IoServiceStatistics methods are called for every new session creation
- Resolved