lvs吞吐率为什么没单台服务器的吞吐率高

zs123123 发布于 2016/04/09 21:19
阅读 457
收藏 0
LVS

我的keepalived.conf配置

3个虚拟机

192.168.31.186 DR模式

192.168.31.113 DR模式

192.168.31.179 nat模式兼职LVS机器


! Configuration File for keepalived

global_defs {
   router_id LVSMaster
}

vrrp_instance VI_1 {
    state MASTER
    interface eth0 
    virtual_router_id 100
    priority 100 
    advert_int 1 
    authentication { 
        auth_type PASS
        auth_pass 123456   
    } 
    virtual_ipaddress { 
        192.168.31.200
    }
}

virtual_server 192.168.31.200 80 {
    delay_loop 6
    lb_algo wrr 
    lb_kind NAT 
    protocol TCP  

    real_server 192.168.31.179 8881 { 
        weight 10 
        TCP_CHECK { 
            connect_timeout 3
            nb_get_retry 3
            delay_before_retry 3
            connect_port 8881
        }
    }
}

virtual_server 192.168.31.200 80 {
    delay_loop 6
    lb_algo wrr
    lb_kind DR
    protocol TCP

    real_server 192.168.31.113 80 {
        weight 20
        TCP_CHECK {
            connect_timeout 3
            nb_get_retry 3
            delay_before_retry 3
            connect_port 80
        }
    }

    real_server 192.168.31.186 80 {
        weight 10
        TCP_CHECK {
            connect_timeout 3
            nb_get_retry 3
            delay_before_retry 3
            connect_port 80
        }

    }


}


web压力测试

ab -n 20000 -c 410 http://192.168.31.113/ 这就是一台LVS里面的真实机器

Server Software:        nginx/1.4.6
Server Hostname:        192.168.31.113
Server Port:            80

Document Path:          /
Document Length:        7200 bytes

Concurrency Level:      410
Time taken for tests:   7.968 seconds
Complete requests:      20000
Failed requests:        0
Total transferred:      147340000 bytes
HTML transferred:       144000000 bytes
Requests per second:    2509.98 [#/sec] (mean)
Time per request:       163.348 [ms] (mean)
Time per request:       0.398 [ms] (mean, across all concurrent requests)
Transfer rate:          18057.63 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0   34  70.2     25    1071
Processing:    23  128  45.8    127     381
Waiting:       17  117  45.8    116     335
Total:         34  161  76.1    154    1176

Percentage of the requests served within a certain time (ms)
  50%    154
  66%    167
  75%    178
  80%    184
  90%    214
  95%    231
  98%    252
  99%    298
 100%   1176 (longest request)



ab -n 20000 -c 410 http://192.168.31.200/ LVS的VIP

Server Software:        nginx/1.4.6
Server Hostname:        192.168.31.200
Server Port:            80

Document Path:          /
Document Length:        261 bytes

Concurrency Level:      410
Time taken for tests:   9.157 seconds
Complete requests:      20000
Total transferred:      113008135 bytes
HTML transferred:       109298061 bytes
Requests per second:    2184.20 [#/sec] (mean)
Time per request:       187.712 [ms] (mean)
Time per request:       0.458 [ms] (mean, across all concurrent requests)
Transfer rate:          12052.37 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0  104 304.5     31    3058
Processing:     0   80 243.6     51    5664
Waiting:        0   70 237.9     43    5501
Total:          1  184 396.2     87    6971

Percentage of the requests served within a certain time (ms)
  50%     87
  66%    114
  75%    130
  80%    143
  90%    273
  95%   1068
  98%   1145
  99%   1317
 100%   6971 (longest request)



反而没单台机器的好,为什么啊

加载中
0
yak
yak
因为一个人干活比两个人干活快 省去了沟通成本    另外lvs必须配置3台以上,两台机器中如果一台挂了,所有的流量会迅速导向另一台机器,另一台也会瞬间挂掉
OSCHINA
登录后可查看更多优质内容
返回顶部
顶部
返回顶部
顶部