【发布时间】:2015-03-23 03:12:45
【问题描述】:
我正在以下列方式使用在此处 (https://github.com/zeromq/majordomo) 找到的 majordomo 代码:
我没有使用单个 broker 来处理请求和回复,而是启动了两个 brokers,这样其中一个处理所有请求,另一个处理所有回复。
我做了一些测试,看看 majordomo broker 可以处理多少个连接:
num of reqs per client num of requests handled without pkt loss
1 614 (614 clients)
10 6000 (600 clients)
100 35500 (355 clients)
1000 300000 (300 clients)
5000 750000
10000 600000
15000 450000
20000 420000
25000 375000
30000 360000
我无法正确理解结果。
为什么代理只能处理 614 个客户端,而每个客户端只发送一个请求?
我在一台机器上运行了这个测试,但 614 似乎仍然很低。
谁能告诉我可能出了什么问题?
所以我将 HWM 设置如下:
Broker’s HWM on send/receive is set to 40 k.
TCP send/receive buffer is set to 10 MB.
Worker’s HWM on send/receive is set to 100 k.
Client’s HWM on send is set to 100,
and on receive is set to 100 k.
All the clients run on the same machine.
All the workers (10 workers running the echo service),
and the two broker instances run on a single ec2 instance.
Client program simply sends all the requests in a blast (all at once).
我对 HWM on send 的理解是,当到达 HWM 时,socket 会阻塞。这就是为什么我将客户端的 send HWM 设置为 100 条消息,希望这会给我某种流量控制。
现在,当我有 10 个客户端发送 10,000 个请求(一次完成)时,我看到数据包丢失。并且,当客户端每个发送 10,000 个请求,但一次只发送前 1000 个请求时,当 128 个客户端并行运行时会发生丢包。
当我将代理的 HWM 设置为 40k 时,为什么当爆炸大小小于 40,000 时它会丢弃数据包(就像我上面使用的那样)?我知道 zmq 指南说管道的分配容量约为我们设置的容量的 60%,但 10,000 只是我设置的容量 (40,000) 的 25%。同理,1000 只占 10%。所以我不明白是什么导致代理丢失数据包。 HWM 应该是每个对等连接,不是吗?请帮助我理解这种行为。
【问题讨论】:
标签: zeromq distributed distributed-computing