udp流量与Iperf为haproxy [英] udp traffic with Iperf for haproxy

查看:300
本文介绍了udp流量与Iperf为haproxy的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Docker Container进行Haproxy的性能评估项目。我使用Python编程,并使用iperf来生成流量。



我创建了几个Docker容器作为客户端和服务器。客户端应该通过作为负载平衡器的Haproxy容器将udp流量发送到服务器。



问题是当我尝试将udp流量从客户端发送到服务器时, Haproxy拒绝连接。
我没有在官方文档中找到如何绑定或收听UDP端口。



提前谢谢你的回复。



这是我的haproxy.cfg的副本。



global
quiet
nbproc 4
守护程序
听tcp_haproxy 172.17.4.230:5001
余额roundrobin
服务器server0 172.17.4.227:5001
服务器server1 172.17.4.228:5001
服务器server2 172.17.4.229:5001

解决方案

更多关于UDP负载平衡比Docker。如果我误解了这个问题,请随时更正我。



你可能不会喜欢这个答案,但是在这里。 HAProxy不支持UDP 官方主页明确地将HAProxy描述为TCP和HTTP 代理(暗示,这意思是无UDP)。关于UDP负载平衡的主题,还有关于ServerFault的此问题,其中也讨论并快速解雇HAProxy。



由于我不喜欢这是不可能的,处理它作为一个答案我们来看看替代品。 / p>


  1. 有些关于UDP负载平衡的资源最终会推荐 IPVS 作为负载均衡器。它是Linux内核的一部分,如果您正在寻找基于Docker的内容,这将使其成为一个不错的解决方案。如果这不是您的交易破坏者,那么维基百科页面上的简短示例可以使用三个UDP服务器调整您的方案:

      ipvsadm -A -u 172.17.4.230:5001 -s rr 
    ipvsadm -a -u 172.17.4.230:5001 -r 172.17.4.227:5001 -m
    ipvsadm -a -u 172.17.4.230:5001 -r 172.17.4.228:5001 -m
    ipvsadm - a -u 172.17.4.230:5001 -r 172.17.4.229:5001 -m


  2. A快速的Google搜索引发了替代的开源解决方案,如。可能还值得一看吗?


  3. 您是否不能使用TCP? ;)



I'm working on my personal project on "performance evaluation" of Haproxy using Docker Container. I'm programming with Python and uses iperf for traffic generation.

I created several Docker containers as clients and servers. The clients are supposed to send udp traffic to servers via Haproxy container which acts as a load balancer.

The issue is when I try to send udp traffic from clients to servers, Haproxy refuses the connexions. I did not find in the official documentation how to bind or listen to UDP port.

Thank you in advance for your reply.

Here is a copy of my haproxy.cfg.

global quiet nbproc 4 daemon listen tcp_haproxy 172.17.4.230:5001 balance roundrobin server server0 172.17.4.227:5001 server server1 172.17.4.228:5001 server server2 172.17.4.229:5001

解决方案

As I read it, this question is more about UDP load balancing than Docker. Please feel free to correct me if I misread the question.

You probably won't like this answer, but here goes. HAProxy does not support UDP. The official homepage describes HAProxy as TCP and HTTP proxy explicitly (by implication, this means "no UDP"). There are also this question on ServerFault regarding the topic of UDP load balancing, which also discusses and quickly dismisses HAProxy.

Since I don't like "that's not possible, deal with it" as an answer myself, let's have a look at alternatives.

  1. Some resources that ask about UDP load balancing end up recommending IPVS as load balancer. It's part of the Linux kernel, which makes it a bad solution if you're looking for something based on Docker. If that's not a deal breaker for you, there a short example on the Wikipedia page that can be adjusted to your scenario with three UDP servers:

    ipvsadm -A -u 172.17.4.230:5001 -s rr
    ipvsadm -a -u 172.17.4.230:5001 -r 172.17.4.227:5001 -m
    ipvsadm -a -u 172.17.4.230:5001 -r 172.17.4.228:5001 -m
    ipvsadm -a -u 172.17.4.230:5001 -r 172.17.4.229:5001 -m
    

  2. A quick Google search turns up alternative open-source solutions like Pen. Might also be worth a look?

  3. Sure you can't use TCP instead? ;)

这篇关于udp流量与Iperf为haproxy的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆