servicecomb-pack icon indicating copy to clipboard operation
servicecomb-pack copied to clipboard

Problem for Saga Load Balance Strategy

Open jiuang opened this issue 6 years ago • 4 comments

Currently, Saga's load balancer will select a fastest 'MessageSender' to send msg from pool.

My problem: At some point, if every Alpha node need take 10 minutes to handle business for some reasons(e.g. network), that means, Saga will handle all following requests by the fastest 'MessageSender' within 10 minutes. So, I think that the performance for Saga's load balancer will get a discount.

Of course, I believe one alpha node can handle many many requests. Just for improving Saga.

Part of code from LoadBalancedClusterMessageSender.java ....

MessageSender messageSender = fastestSender();
try {
        long startTime = System.nanoTime();
        AlphaResponse response = messageSender.send(event);
        senders.put(messageSender, System.nanoTime() - startTime);
        return response;
} catch (OmegaException e) {
        throw e;
}

Please point them out when I make some mistakes. Thank you.

jiuang avatar Jul 16 '18 06:07 jiuang

We should support to apply different strategy on the LoadBalancer. Please feel free to create a JIRA for it. It could be great if you can submit a PR for it.

WillemJiang avatar Jul 17 '18 03:07 WillemJiang

How to apply different strategies on the Load Balancer? Probably, I have not an in-depth study on it. Please give me some hints. Thank you! BTW, follow your advice, I created a JIRA for it.

Please point them out when I make some mistakes. Thank you!

jiuang avatar Jul 17 '18 09:07 jiuang

Hi Jiang!

I upgraded the Saga program(even though an informality version) and I read the source of 'LoadBalancedClusterMessageSender.java'. And I thought it was almost same between the last source and the former in terms of function. How do you think? Or I probably located a wrong position?

image image

By the way, why did you downgrade the JDK version for latest Saga?

issue url: https://github.com/apache/incubator-servicecomb-saga/issues/222

jiuang avatar Aug 20 '18 05:08 jiuang

@Gannalyo , as the user could use JDK7, we change the code of Omega to support JDK7.

WillemJiang avatar Nov 06 '18 01:11 WillemJiang