[lvs-users] lvs scheduling lb_algo

Fernando Silva fernando.silva at sickkids.ca
Tue Dec 3 15:50:13 GMT 2019


Hi Greame, appreciate the response.  I've tried setting it to 1.  Unfortunately I'm getting the same behavior.
Single client sshing into 172.20.5.7 gets the same real server every time.

My config, maybe someone will see an error on my part.

------------------------------------------------------------------------------------
vrrp_instance VI_1 {
    state MASTER
    interface ens3
    #smtp_alert
    virtual_router_id 50
    priority 100
    advert_int 1
    authentication {
        auth_type PASS
        auth_pass *****
    }
    virtual_ipaddress {
        172.20.5.7
    }
}

vrrp_instance VI_2 {
    state BACKUP
    interface ens3
    #smtp_alert
    virtual_router_id 51
    priority 90
    advert_int 1
    authentication {
        auth_type PASS
        auth_pass *****
    }
    virtual_ipaddress {
        172.20.5.8
    }
}

virtual_server 172.20.5.7 22 {
    delay_loop 6
    lvs_sched rr
    lvs_method DR
    persistence_timeout 1
    protocol TCP

    real_server 172.20.5.43 22
        weight 1
        TCP_CHECK {
            connect_timeout 3
            nb_get_retry 3
            delay_before_retry 3
            connect_port 22
        }
    }

    real_server 172.20.5.55 22 {
        weight 1
        TCP_CHECK {
            connect_timeout 3
            nb_get_retry 3
            delay_before_retry 3
            connect_port 22
        }
    }
}

virtual_server 172.20.5.8 22 {
    delay_loop 6
    lvs_sched rr
    lvs_method DR
    persistence_timeout 1
    protocol TCP

    real_server 172.20.5.43 22
        weight 1
        TCP_CHECK {
            connect_timeout 3
            nb_get_retry 3
            delay_before_retry 3
            connect_port 22
        }
    }

    real_server 172.20.5.55 22 {
        weight 1
        TCP_CHECK {
            connect_timeout 3
            nb_get_retry 3
            delay_before_retry 3
            connect_port 22
        }
    }
}



________________________________
From: lvs-users-bounces at linuxvirtualserver.org <lvs-users-bounces at linuxvirtualserver.org> on behalf of Graeme Fowler <graeme at graemef.net>
Sent: December 3, 2019 6:13 AM
To: LinuxVirtualServer.org users mailing list. <lvs-users at linuxvirtualserver.org>
Subject: Re: [lvs-users] lvs scheduling lb_algo

On 2 Dec 2019, at 21:29, Fernando Silva <fernando.silva at sickkids.ca> wrote:
> Am I missing something obvious?

Do you have ‘persistence_timeout’ set or not in your keepalived configuration?

If not, it defaults to 6 minutes - which means if you open a new connection within that time of any other traffic traversing the  director, you’ll get sent to the same realserver.

If you set it to something short(ish) you should get the behaviour you require. I think.

Graeme
_______________________________________________
Please read the documentation before posting - it's available at:
https://urldefense.proofpoint.com/v2/url?u=http-3A__www.linuxvirtualserver.org_&d=DwIGaQ&c=Sj806OTFwmuG2UO1EEDr-2uZRzm2EPz39TfVBG2Km-o&r=F7FxI8cxrP6QonYAsyEJS2S0KBz_nqc6pkaeptmoH5g&m=SRlFuT63kb0e9iFQ_1SfEZeEdih1fEuIahMRCDdyzeQ&s=lhPeIgMvpJk4ihMvDO20lC8kuu5O-u0uMfIkZnu5s9M&e=

LinuxVirtualServer.org mailing list - lvs-users at LinuxVirtualServer.org
Send requests to lvs-users-request at LinuxVirtualServer.org
or go to https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.graemef.net_mailman_listinfo_lvs-2Dusers&d=DwIGaQ&c=Sj806OTFwmuG2UO1EEDr-2uZRzm2EPz39TfVBG2Km-o&r=F7FxI8cxrP6QonYAsyEJS2S0KBz_nqc6pkaeptmoH5g&m=SRlFuT63kb0e9iFQ_1SfEZeEdih1fEuIahMRCDdyzeQ&s=eFtU91_oVEasLMHLOe_cpyL70IxGb5JzcffYX8jGR88&e=

________________________________

This e-mail may contain confidential, personal and/or health information(information which may be subject to legal restrictions on use, retention and/or disclosure) for the sole use of the intended recipient. Any review or distribution by anyone other than the person for whom it was originally intended is strictly prohibited. If you have received this e-mail in error, please contact the sender and delete all copies.


More information about the lvs-users mailing list