LVS NAT 配置方式访问速度有时候很慢

您好,请问LVS的NAT配置方式(用四个IP四个网卡和HA方式)的访问速度有时候会很慢呢?
下面是keepalived.conf的配置:
#Configuration File for keepalived

#TransportServer
virtual_server 10.100.1.248 80 {
lb_algo rr
lb_kind NAT
protocol TCP

real_server 192.168.3.101 80 {
weight 1
ICMP_CHECK
}
real_server 192.168.3.102 80 {
weight 1
ICMP_CHECK
}
}

#WebServer
virtual_server 10.100.1.249 80 {
lb_algo rr
lb_kind NAT
protocol TCP

real_server 192.168.4.11 80 {
weight 1
ICMP_CHECK
}
real_server 192.168.4.12 80 {
weight 1
ICMP_CHECK
}
}

#end of Fweb config!
下面是lvs.sh的配置:
#!/bin/bash
#/etc/lvs.sh
#open IP Forwarding
ifconfig eth1:0 192.168.3.254
ifconfig eth2:0 192.168.4.254
echo "1" > /proc/sys/net/ipv4/ip_forward
#To make the load balancer forward the masquerading packets
#flush the iptables

/sbin/iptables -F
/sbin/iptables -X
/sbin/iptables -Z

/sbin/iptables -F -t nat
/sbin/iptables -X -t nat
/sbin/iptables -Z -t nat

#/sbin/iptables -t nat -A PREROUTING -p tcp -d 10.10.1.100 --dport 80 -j #DNAT --to-destination 192.168.1.102:80
#/sbin/iptables -t nat -A PREROUTING -p tcp -d 10.10.1.100 --dport 80 -j #DNAT --to-destination 192.168.1.101:80

/sbin/iptables -t nat -A POSTROUTING -p tcp -s 192.168.3.0/24
/sbin/iptables -t nat -A POSTROUTING -p tcp -s 192.168.4.0/24

/sbin/ipvsadm -C

[root@LVS_MASTER ~]# ipvsadm -L
IP Virtual Server version 1.2.0 (size=4096)
Prot LocalAddress:Port Scheduler Flags
-> RemoteAddress:Port Forward Weight ActiveConn InActConn
TCP 10.100.1.248:http rr
-> 192.168.3.102:http Masq 1 0 1
-> 192.168.3.101:http Masq 1 1 1
TCP 10.100.1.249:http rr
-> 192.168.4.12:http Masq 1 0 2
-> 192.168.4.11:http Masq 1 0 1

在客户端访问有时候快,有时候慢,请问有配置有什么问题吗?非常感谢您的问答!

Forums:

randomness