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

Ian Babrou commented on ZOOKEEPER-1516:
---------------------------------------

Probably i misunderstood this parameter. It's okay to leave it hardcoded, but 
this parameter is also used here:

{code:title=FastLeaderElection.java|borderStyle=solid}
// Verify if there is any change in the proposed leader
while((n = recvqueue.poll(finalizeWait,
        TimeUnit.MILLISECONDS)) != null){
    if(totalOrderPredicate(n.leader, n.zxid,
            proposedLeader, proposedZxid)){
        recvqueue.put(n);
        break;
    }
}
{code}

Here we wait for new notification when new leader is really elected. We just 
wait for 200ms when everything is pretty stable. This value may be lowered with 
not damage for algorithm converging.
                
> Configurable finalizeWait for FastLeaderElection
> ------------------------------------------------
>
>                 Key: ZOOKEEPER-1516
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1516
>             Project: ZooKeeper
>          Issue Type: Improvement
>          Components: leaderElection, quorum, server
>    Affects Versions: 3.3.5
>         Environment: Gentoo linux, any environment is affected.
>            Reporter: Ian Babrou
>              Labels: performance
>
> FastLeaderElection has final static int finalizeWait = 200. This is time to 
> wait after successful leader election. I don't know what could happen, but 
> 200ms is too slow for production environment under heavy load.
> I changed it to 20ms and everything still works for me.
> I propose to make this value configurable with default value of 200 to not 
> affect current installations.
> Combined with #ZOOKEEPER-1515 it could improve leader election and make it 
> 10x times faster: 1500ms -> 180ms including 100ms for 2 faileed new leader 
> connections.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to