Re: [Keepalived-devel] Failover takes 3-5 seconds
Status: Beta
Brought to you by:
acassen
|
From: Sébastien R. <seb...@fr...> - 2012-04-29 12:43:08
|
This time is based on the VRRP (in vrrp v2 time in is seconds, in vrrp
v3 in centiseconds).
1 second = 100 centiseconds
Skew_Time Time to skew Master_Down_Interval in
centiseconds. Calculated as
(((256 - priority) * Master_Adver_Interval) / 256)
Master_Down_Interval Time interval for Backup to declare
Master down (centiseconds).
Calculated as
(3 * Master_Adver_Interval) + Skew_time
So if advert_int is 1 (100 centiseconds) and priority is 100 :
3*100 + ( (256-100) * 100 ) / 256 ) = 361 centiseconds, 3,61 seconds.
You have to add the refresh time, so it can take about 4 seconds...
There's some keepalived patches to use centiseconds.
In a real cluster, 4 seconds is not a problem.
Le 29/04/2012 12:53, Bar Ziony a écrit :
> Hi,
>
> I've setup keepalived in a MASTER/BACKUP configuration on 2 servers.
> I'll paste the configuration of both at the end of the message.
>
> Everything is working perfectly - When the check fails on MASTER, the
> virtual IP is swapped and the failover happens. When I kill keepalived
> on the MASTER, it happens too. When I bring keepalived or the check
> passes on the lower priority server, the failover happens.
>
> However, This failover takes 3-5 seconds, during which I can see 3-4
> packets lost on a regular 'ping VIRTUAL_IP' (1-sec interval ICMP). Is
> this normal? Can this be lower? in 5 seconds I can lose quite a bit of
> HTTP requests from users, since we have a pretty high-volume website.
>
> Note: I'm using keepalived 1.1.20 with Willy Tarreau (haproxy author)
> unicast patch:
> http://1wt.eu/keepalived/keepalived-1.1.19-unicast.patch . It works great.
>
> Here are the configurations:
>
> MASTER:
> global_defs {
> notification_email {
> em...@ex... <mailto:em...@ex...>
> }
> notification_email_from "Keepalived <kee...@lb...
> <mailto:kee...@lb...>>"
> smtp_server 192.168.100.100
> smtp_connect_timeout 30
> }
>
> vrrp_script chk_haproxy {
> script "kill -0 `cat /var/run/haproxy.pid`"
> interval 2 # check every 2 seconds
> weight 2 # add 2 points of priority if OK
> }
>
> vrrp_instance VI_1 {
> state MASTER
> interface eth0
> virtual_router_id 51
> advert_int 1
> priority 101 # 101 on master, 100 on backup
> vrrp_unicast_bind 192.168.1.1 # Internal IP of this machine
> vrrp_unicast_peer 192.168.1.2 # Internal IP of peer
> smtp_alert
> authentication {
> auth_type PASS
> auth_pass my_pass
> }
> virtual_ipaddress {
> 50.1.1.1
> }
> track_script {
> chk_haproxy
> }
> }
>
>
>
> BACKUP:
>
> global_defs {
> notification_email {
> em...@ex... <mailto:em...@ex...>
> }
> notification_email_from "Keepalived <kee...@lb...
> <mailto:kee...@lb...>>"
> smtp_server 192.168.100.100
> smtp_connect_timeout 30
> }
>
> vrrp_script chk_haproxy {
> script "kill -0 `cat /var/run/haproxy.pid`"
> interval 2 # check every 2 seconds
> weight 2 # add 2 points of priority if OK
> }
>
> vrrp_instance VI_1 {
> state BACKUP
> interface eth0
> virtual_router_id 51
> advert_int 1
> priority 100 # 101 on master, 100 on backup
> vrrp_unicast_bind 192.168.1.2 # Internal IP of this machine
> vrrp_unicast_peer 192.168.1.1 # Internal IP of peer
> smtp_alert
> authentication {
> auth_type PASS
> auth_pass my_pass
> }
> virtual_ipaddress {
> 50.1.1.1
> }
> track_script {
> chk_haproxy
> }
> }
>
>
> Thanks,
> Bar.
>
>
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
>
>
> _______________________________________________
> Keepalived-devel mailing list
> Kee...@li...
> https://lists.sourceforge.net/lists/listinfo/keepalived-devel
|