qpid-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF subversion and git services (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (DISPATCH-888) Balanced distribution algorithm visits each link to determine the best_eligible_link
Date Tue, 05 Dec 2017 14:36:04 GMT

    [ https://issues.apache.org/jira/browse/DISPATCH-888?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16278630#comment-16278630
] 

ASF subversion and git services commented on DISPATCH-888:
----------------------------------------------------------

Commit d5f279b8b85e8ee4378c195666824b13b327e39e in qpid-dispatch's branch refs/heads/master
from [~tross@redhat.com]
[ https://git-wip-us.apache.org/repos/asf?p=qpid-dispatch.git;h=d5f279b ]

DISPATCH-888 - Added optimization for balanced distribution when a zero-cost link is found.
Hat Tip: Ganesh Murthy
This closes #227


> Balanced distribution algorithm visits each link to determine the best_eligible_link
> ------------------------------------------------------------------------------------
>
>                 Key: DISPATCH-888
>                 URL: https://issues.apache.org/jira/browse/DISPATCH-888
>             Project: Qpid Dispatch
>          Issue Type: Improvement
>          Components: Container
>    Affects Versions: 1.0.0
>            Reporter: Ganesh Murthy
>            Assignee: Ganesh Murthy
>            Priority: Minor
>             Fix For: 1.1.0
>
>
> 1. In forwarder.c (qdr_forward_balanced_CT()) the loop that selects the best_eligible_link
loops thru all rlinks as seen below
> {noformat}
>     while (link_ref) {
>         qdr_link_t *link     = link_ref->link;
>         uint32_t    value    = DEQ_SIZE(link->undelivered) + DEQ_SIZE(link->unsettled);
>         bool        eligible = link->capacity > value;
>         //
>         // If this is the best eligible link so far, record the fact.
>         // Otherwise, if this is the best ineligible link, make note of that.
>         //
>         if (eligible && eligible_link_value > value) {
>             best_eligible_link  = link;
>             eligible_link_value = value;
>         } else if (!eligible && ineligible_link_value > value) {
>             best_ineligible_link  = link;
>             ineligible_link_value = value;
>         }
>         link_ref = DEQ_NEXT(link_ref);
>     }
> {noformat}
> Instead the code can exit the loop if the value is 0 (zero). When there are no outstanding
deliveries on a link we can without doubt choose that link as the best one to send the delivery.

> 2. Rotate the rlinks list only if value is zero to avoid frequent list rotation. In the
synchronous case, the code still works.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org


Mime
View raw message