免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 40628 | 回复: 0
打印 上一主题 下一主题

经过haproxy操作mysql性能疑问 [复制链接]

论坛徽章:
3
数据库技术版块每日发帖之星
日期:2016-05-27 06:20:00数据库技术版块每日发帖之星
日期:2016-06-04 06:20:00数据库技术版块每日发帖之星
日期:2016-06-23 06:20:00
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2018-07-24 11:37 |只看该作者 |倒序浏览
请问大家有用过haproxy做mysql的代理吗?
我这里测试了一下经过haproxy向后端mysql写200万记录要了60分钟,不经过haproxy直接写入mysql的只要了30分钟
采用haproxy写入数据时间多了一倍,请问是什么原因呢,是不是我的haproxy配置有问题。


我的haproxy配置如下:
[root@localhost conf]# more haproxy.cfg
global
        log             127.0.0.1        local3 info
        maxconn         10000
        user            haproxy
        group           haproxy
        nbproc          1
        pidfile         /var/run/haproxy.pid
        #debug
        #quiet
defaults
        log            global
        option         tcplog
        option         dontlognull
        retries        3
        option         redispatch
        maxconn        10000
        timeout        connect  10s
        timeout        client     10s
        timeout        server    48h

listen stats
    mode http
    bind :6677
    stats enable
    stats hide-version
    stats uri     /haproxyadmin?stats
    stats realm   Haproxy\ Statistics
    stats auth    admin:admin
    stats admin if TRUE

listen  pxc-galera
        bind 0.0.0.0:3308
        option mysql-check user haproxy
        balance  leastconn
        server   db1  192.168.1.118:3307 weight 1 check  inter 1s rise 2 fall 2
        server   db2  192.168.1.101:3307 weight 1 check  inter 1s rise 2 fall 2
        server   db3  192.168.1.129:3307 weight 1 check  inter 1s rise 2 fall 2



您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP