测试订阅时候大量的shutdown,tcp_closed,是什么原因

喔。我多试试各种情况吧。感觉阿里云上部署的server没有这种问题,不知道是不是阿里云公网网速慢,传过去需要时间很长。我现在是内网测试,内网的网速 很大,一下子 数据全部发了过去。(猜测)

那我把server端的CPU改成64核心也试试看。

公网的话,很可能是网络限制,你先逐渐增量的增加连接数。有本地环境的进行对比更好。

看起来不是CPU的问题,CPU已经加到了64核心,看起来占用率不高,然后订阅数10000发过去,mqtt一分钟不到 就挂了,得systemctl start emqx开启服务。

提示这个,跟测试工具emqtt_bench是不是有关系?

client(2025): EXIT for {shutdown,tcp_closed}
client(2004): EXIT for {shutdown,tcp_closed}
=CRASH REPORT==== 25-Jun-2021::17:23:48.203127 ===
  crasher:
    pid: <0.631.0>
    registered_name: []
    exception exit: {noproc,
                        {gen_statem,call,
                            [<0.632.0>,
                             {publish,
                                 {mqtt_msg,0,false,false,undefined,
                                     <<"test">>,#{},<<"aaaaaaaaaaaaaaaa">>}},
                             infinity]}}
      in function  gen:do_call/4 (gen.erl, line 218)
      in call from gen_statem:call_dirty/4 (gen_statem.erl, line 671)
      in call from emqtt_bench:publish/2 (/root/emqtt-bench-master/src/emqtt_bench.erl, line 470)
      in call from emqtt_bench:loop/5 (/root/emqtt-bench-master/src/emqtt_bench.erl, line 410)
    ancestors: []
    message_queue_len: 1
    messages: [{'EXIT',<0.632.0>,{shutdown,tcp_closed}}]
    links: [<0.115.0>]
    dictionary: [{rand_seed,{#{jump => #Fun<rand.3.47293030>,
                                max => 288230376151711743,
                                next => #Fun<rand.5.47293030>,type => exsplus},
                              [219000802233233608|107032127440428347]}}]
    trap_exit: true
    status: running
    heap_size: 610
    stack_size: 26
    reductions: 354091
  neighbours:

sent(32000): total=40359, rate=1685(msg/sec)
pub(32000): total=40359, rate=1680(msg/sec)

这个是你的内网还是公网,如果公网,测试的时候,你长ping 大包一下,看看丢包如何

内网的测试。

里面 --interval_of_msg -I 每间隔多少时间发送一个消息。这个参数单位是毫秒?还是秒?