Skip to content
  • Miciah Masters's avatar
    Change default balancing algorithm to "leastconn" · b1a50405
    Miciah Masters authored
    Configure OpenShift router to use the "leastconn" balancing algorithm for
    non-passthrough routes by default.
    
    This was the default algorithm for non-passthrough routes before it was
    changed to "random" in OpenShift 4.8.  The "random" algorithm is expected
    to provide better behavior across reloads or multiple router pod replicas.
    However, it incurs significant memory overhead for each backend that uses
    it, and so we need to change the default back to "leastconn" in order to
    avoid excessive memory usage until we can fix the issue in HAProxy.
    
    This commit fixes bug 2007581.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=2007581
    
    * pkg/operator/controller/ingress/deployment.go (desiredRouterDeployment):
    Change the default balancing algorithm for non-passthrough routes to
    "leastconn", and allow an override to set "random".
    * pkg/operator/controller/ingress/deployment_test.go
    (TestDesiredRouterDeployment): Update to expect "leastconn".
    * test/e2e/operator_test.go
    (TestLoadBalancingAlgorithmUnsupportedConfigOverride): Update to expect
    "leastconn" as the default setting and verify that the override allows
    setting "random".  Add a check that passthrough routes use "source".
    b1a50405