Github user necouchman commented on a diff in the pull request:
https://github.com/apache/incubator-guacamole-client/pull/161#discussion_r120248638
--- Diff:
extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/java/org/apache/guacamole/auth/jdbc/tunnel/RestrictedGuacamoleTunnelService.java
---
@@ -180,8 +187,8 @@ protected ModeledConnection
acquire(RemoteAuthenticatedUser user,
@Override
public int compare(ModeledConnection a, ModeledConnection b) {
- return getActiveConnections(a).size()
- - getActiveConnections(b).size();
+ return ((getActiveConnections(a).size() + 1) *
b.getConnectionWeight() -
--- End diff --
Okay, that makes sense. So I guess what we're going for here is keeping
the ratio under the specified limit - that is, if 10:1 is the configured ratio
(based on configured weights of the servers), then work up to that, then drop
back down. It's still, mathematically, unbalanced (you end up with a 5.5:1
ratio), but it keeps it "in bounds" so to speak.
I've tweaked the code such that it computes the net weight of each of the
connections, and, if they're equal, returns the difference between the
configured weight of each system, otherwise returns the difference in the net
weight. Does that look more like what we're going for in a WLC algorithm?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---