Mailing List Archive

[lvs-users] lvs scheduling lb_algo
Hi, New to lvs/keepalived/ipvsadm. Using lvs/keepalived to load
balance ssh servers. With a single client every connection I make goes
to the same "real server". I have 2 real servers. I have to ssh in
from a completely different source IP in order to be sent to a
different "real server". Ideally I would like every connection
regardless of source IP to get balanced. I've tried all 10 scheduling
options with no luck. Am I missing something obvious?

Using Direct Routing for load balancing.

Thanks in advance.


________________________________

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.
_______________________________________________
Please read the documentation before posting - it's available at:
http://www.linuxvirtualserver.org/

LinuxVirtualServer.org mailing list - lvs-users@LinuxVirtualServer.org
Send requests to lvs-users-request@LinuxVirtualServer.org
or go to http://lists.graemef.net/mailman/listinfo/lvs-users
Re: [lvs-users] lvs scheduling lb_algo [ In reply to ]
On 2 Dec 2019, at 21:29, Fernando Silva <fernando.silva@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:
http://www.linuxvirtualserver.org/

LinuxVirtualServer.org mailing list - lvs-users@LinuxVirtualServer.org
Send requests to lvs-users-request@LinuxVirtualServer.org
or go to http://lists.graemef.net/mailman/listinfo/lvs-users
Re: [lvs-users] lvs scheduling lb_algo [ In reply to ]
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@linuxvirtualserver.org <lvs-users-bounces@linuxvirtualserver.org> on behalf of Graeme Fowler <graeme@graemef.net>
Sent: December 3, 2019 6:13 AM
To: LinuxVirtualServer.org users mailing list. <lvs-users@linuxvirtualserver.org>
Subject: Re: [lvs-users] lvs scheduling lb_algo

On 2 Dec 2019, at 21:29, Fernando Silva <fernando.silva@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@LinuxVirtualServer.org
Send requests to lvs-users-request@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.
_______________________________________________
Please read the documentation before posting - it's available at:
http://www.linuxvirtualserver.org/

LinuxVirtualServer.org mailing list - lvs-users@LinuxVirtualServer.org
Send requests to lvs-users-request@LinuxVirtualServer.org
or go to http://lists.graemef.net/mailman/listinfo/lvs-users
Re: [lvs-users] lvs scheduling lb_algo [ In reply to ]
On 3 Dec 2019, at 15:50, Fernando Silva <fernando.silva@sickkids.ca> wrote:
> I've tried setting it to 1.

Try 0, then open multiple connections.

Graeme

_______________________________________________
Please read the documentation before posting - it's available at:
http://www.linuxvirtualserver.org/

LinuxVirtualServer.org mailing list - lvs-users@LinuxVirtualServer.org
Send requests to lvs-users-request@LinuxVirtualServer.org
or go to http://lists.graemef.net/mailman/listinfo/lvs-users
Re: [lvs-users] lvs scheduling lb_algo [ In reply to ]
That did the trick.

Is there away to force disconnect an entry shown in ipvsadm -lc?
I see stale connections making messing with my test results.

Once again, I'm very appreciative of your assistance.

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

On 3 Dec 2019, at 15:50, Fernando Silva <fernando.silva@sickkids.ca> wrote:
> I've tried setting it to 1.

Try 0, then open multiple connections.

Graeme

_______________________________________________
Please read the documentation before posting - it's available at:
https://urldefense.proofpoint.com/v2/url?u=http-3A__www.linuxvirtualserver.org_&d=DwICAg&c=Sj806OTFwmuG2UO1EEDr-2uZRzm2EPz39TfVBG2Km-o&r=F7FxI8cxrP6QonYAsyEJS2S0KBz_nqc6pkaeptmoH5g&m=lMwLvBUEkD-DpNl7MX9Z_HrnuiVRJaKbsB-WjoU63X4&s=m3RX2P4KN-bMhyGBC4TkB7j4ZL-BGBFVspgcicZTP3g&e=

LinuxVirtualServer.org mailing list - lvs-users@LinuxVirtualServer.org
Send requests to lvs-users-request@LinuxVirtualServer.org
or go to https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.graemef.net_mailman_listinfo_lvs-2Dusers&d=DwICAg&c=Sj806OTFwmuG2UO1EEDr-2uZRzm2EPz39TfVBG2Km-o&r=F7FxI8cxrP6QonYAsyEJS2S0KBz_nqc6pkaeptmoH5g&m=lMwLvBUEkD-DpNl7MX9Z_HrnuiVRJaKbsB-WjoU63X4&s=wPpus7cP3HGB-KxZGcPBAsFmhrPbqN4EznKxO-AJ2U0&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.
_______________________________________________
Please read the documentation before posting - it's available at:
http://www.linuxvirtualserver.org/

LinuxVirtualServer.org mailing list - lvs-users@LinuxVirtualServer.org
Send requests to lvs-users-request@LinuxVirtualServer.org
or go to http://lists.graemef.net/mailman/listinfo/lvs-users