[jboss-jira] [JBoss JIRA] (JGRP-1980) Improve throughput under contention for FlowControl.Credit

Bela Ban (JIRA) issues at jboss.org
Thu Jan 21 12:16:00 EST 2016


    [ https://issues.jboss.org/browse/JGRP-1980?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13152067#comment-13152067 ] 

Bela Ban edited comment on JGRP-1980 at 1/21/16 12:15 PM:
----------------------------------------------------------

Possible improvements in {{UFC}} ({{MFC}} is not really used by Infinispan, therefore we'll look at it later):
* {{FlowControl$Credit.needsToSendCreditRequest()}} uses the same lock as {{decrementIfEnoughCredits()}} and {{increment()}}. Since this method is called *for every sent message*, using a separate lock will remove roughly 50% of the lock access:
** Every send calls {{decrementIfEnoughCredits()}}: ca. 50%
** Every send calls {{needsToSendCreditRequest()}}: ca. 50%
** A replenishment calls {{increment()}}: ca. 2%. This is not called frequently and depends on the max number of credits, the size of the messages and the number of sender threads

Before implementing any of the above suggestions, a perf test needs to be written, so that we can judge whether a change really improves performance.


was (Author: belaban):
Possible improvements in {{UFC}} ({{MFC}} is not really used by Infinispan, therefore we'll look at it later):
* {{FlowControl$Credit.needsToSendCreditRequest()}} uses the same lock as {{decrementIfEnoughCredits()}} and {{increment()}}. Since this method is called *for every sent message*, using a separate lock will remove roughly 50% of the lock access:
** Every send calls {{decrementIfEnoughCredits()}}: ca. 50%
** Every send calls {{needsToSendCreditRequest()}}: ca. 50%
** A replenishment calls {{increment()}}: ca. 2%. This is not called frequently and depends on the max number of credits, the size of the messages and the number of sender threads

> Improve throughput under contention for FlowControl.Credit
> ----------------------------------------------------------
>
>                 Key: JGRP-1980
>                 URL: https://issues.jboss.org/browse/JGRP-1980
>             Project: JGroups
>          Issue Type: Enhancement
>    Affects Versions: 3.6.6
>            Reporter: Sanne Grinovero
>            Assignee: Bela Ban
>             Fix For: 3.6.8
>
>         Attachments: bla.java
>
>
> The methods {{org.jgroups.protocols.FlowControl.Credit.decrementIfEnoughCredits(long, long)}} and {{org.jgroups.protocols.FlowControl.Credit.decrementAndGet(long)}} are contending the locks on class synchronization when stress testing JGroups.
> Wondering if we can think of polishing the implementation, although it looks like challenging.



--
This message was sent by Atlassian JIRA
(v6.4.11#64026)


More information about the jboss-jira mailing list