On Mon, Sep 28, 2020 at 8:43 AM scutting <[email protected]> wrote:
> Thank you both for your responses. Based on the information in the page > that > ivanmarcus provided, and confirmation from Nick, I have already begun work > on a server-side script that will regularly check the status of all hosts > in > our environment and modify the weights based on the results of the check. > > It seems that the load balancing does not perform as I believe it should > (on > the healthy hosts). I have the weights all set the same within a > connection > group, but when the group is selected, it seems to always start with the > machine that is at the top of the list, rather than actually balancing the > load across all hosts. Is there something that am missing? > > It's probably just a difference in algorithms between what you're expecting and how we've implemented it. The load balancing in Guacamole currently operates most closely to a "Weighted Least Connection" (WLC) algorithm. If all weights are set to the same value, it is simply a "Least Connection" algorithm. That is, Guacamole Client will check the number of connections for each of the members of the group and compare them, and then assign the connection to you that has the least number of other users connected. This is multiplied by the weight of each connection (if the connections are weighted) in order to determine which host should be preferred. The actual code that accomplishes this is here: https://github.com/apache/guacamole-client/blob/0091bb1aea14c567c8166f0ed8eadf7c31b6bd6e/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/java/org/apache/guacamole/auth/jdbc/tunnel/RestrictedGuacamoleTunnelService.java#L184-L212 So, if you are testing it with a single user/connection, you are very likely to get the same connection each time. There is also an "enable session affinity" box that allows you to effectively pin the user session to a particular connection for the duration of the user's login. It sounds to me like you're expecting more of a Round-Robin/Weighted Round-Robin algorithm, where the connections will be cycled through one after the other, factoring in the connection weight to impact that algorithm. Adding different algorithms, including (W)RR has been on my list of things to do for a while, but never quite bubbled up to the top. There's a JIRA issue for it, but, alas, it has not received any attention lately... https://issues.apache.org/jira/browse/GUACAMOLE-322 -Nick
