hi, shuaijunlan > wrote: >> >> When calling the service seven times, the responding order is [A ,A, A, >> >> A, A, B, C].
Not at all, you can try it 7 times At 2018-10-16 14:37:33, "Ian Luo" <ian....@gmail.com> wrote: >I got your point, Jason, Would you mind to update your explanation on >https://github.com/apache/incubator-dubbo/issues/2578? It is convenient for >other people to revisit this issue later :) > >Thanks, >-Ian. > >On Tue, Oct 16, 2018 at 2:25 PM Jason Joo <hblz...@163.com> wrote: > >> Hi, lan >> >> I gave a sample from Nginx® Code in JAVA and gained better performance >> compared to previous one(in that issue reply list). >> >> Junlan's point is not to shuffle the addresses list and to select a >> different node every time as possible, eg: >> >> A:B:C = 1:2:3 >> [A, B, C, B, C, C, A, B, C, B, C, C, A, B, C, B, C, C, >> A, B, C, B, C, C, ......] >> >> especially the factor number is large as: [90 : 100 : 111] >> >> best regards, >> >> Jason >> >> > On Oct 16, 2018, at 14:12, Ian Luo <ian....@gmail.com> wrote: >> > >> > Hi Junlan, >> > >> > Are you suggesting we should shuffle the result address array? >> > >> > Thanks, >> > -Ian. >> > >> > On Fri, Oct 12, 2018 at 4:24 PM Junlan Shuai <shuaijun...@gmail.com> >> wrote: >> > >> >> Hi, >> >> The RoundRobinLoadBalance Algorithm is not smoothing. >> >> For example, assuming that the weight of Server A is five, the weight of >> >> Server >> >> B is one, the weight of Server C is one. >> >> When calling the service seven times, the responding order is [A ,A, A, >> A, >> >> A, B, C]. >> >> By this responding order, we can find that the first five callings >> point to >> >> Server A, it will cause Server A to be overloaded in a short period of >> >> time. >> >> Ideally, the call order would be [A ,A, B, A, C, A, A]. >> >> So, I think there may be a better way to do this. >> >> >> >> KimmKing <kimmk...@apache.org> 于2018年9月30日周日 下午4:09写道: >> >> >> >>> Hi, community. >> >>> >> >>> >> >>> Dubbo user manzhizhen find a preformance bug in >> >>> dubbo-cluster/RoundRobinLoadBalance and discuss in Github Is >> >>> https://github.com/apache/incubator-dubbo/issues/2578 >> >>> >> >>> >> >>> Here I describe it shortly: >> >>> 1. The new version RoundRobinLoadBalance algorithm use an iterator >> from 0 >> >>> to maxWeight: >> >>> for (int i = 0; i < maxWeight; i++) { // this is the reason >> >>> for (Map.Entry<Integer, IntegerWrapper> each : >> >>> invokerToWeightMap.entrySet()) { >> >>> .... >> >>> } >> >>> } >> >>> 2.If maxWeight is a number much more than 100, then this select method >> >>> will be executed so mush slowly. >> >>> 3. When call it 1M times: maxWeight is 5000, then it need 60+ seconds; >> >>> maxWeight is 50000, then it need 10+ minutes. >> >>> 4. And in a deep compare testing, RandomLoadBalance & >> >>> RoundRobinLoadBalance (in 2.5.3, but implement is wrong) need 100-200ms >> >>> while calling 1M times. >> >>> 5. So we should Optimize RoundRobinLoadBalance to a new >> high-performance >> >>> algorithm implement, abandoning iterator from 0 to maxWeight. >> >>> 6. Then gudegg submit a PR to Optimize RoundRobinLoadBalance correctly, >> >>> the balance results by new PR is absolutely correct and only elapse >> >>> 100-300ms in my test like step 3. >> >>> >> >>> >> >>> Think it above over and over, I suggest we should merge the PR >> recently. >> >>> Any questions, buddies? >> >>> >> >>> >> >>> >> >>> >> >>> -- >> >>> Kimm King(kimmk...@apache.org/kimmk...@163.com) >> >>> Apache Dubbo Committer/Alibaba Fastjson Developer/Aliyun MVP >> >>> >> >>> >> >> >> >> -- >> >> Junlan >> >> Best regards! >> >> >> >>