Sfoglia il codice sorgente

perf: do not call inet getstat before each and every send

In a stress test environment, when alarm is enabled, there were
a lot of long_schedule warnings with the stacktrace pointing to
congestion alarm based inet:getstat function.
When alarm is disabled, the one single client is able to
hold 40,000 QoS 1 messages per second (inflight=32) throughput.
When alarm is enabled, its mqueue overflows.

This commit removes the call before each and every data send,
so to rely on emit_stats timer to trigger the congestion check.
zmstone 1 anno fa
parent
commit
5c3f5d8085
1 ha cambiato i file con 0 aggiunte e 1 eliminazioni
  1. 0 1
      apps/emqx/src/emqx_connection.erl

+ 0 - 1
apps/emqx/src/emqx_connection.erl

@@ -914,7 +914,6 @@ send(IoData, #state{transport = Transport, socket = Socket, channel = Channel})
     Oct = iolist_size(IoData),
     ok = emqx_metrics:inc('bytes.sent', Oct),
     inc_counter(outgoing_bytes, Oct),
-    emqx_congestion:maybe_alarm_conn_congestion(Socket, Transport, Channel),
     case Transport:async_send(Socket, IoData, []) of
         ok ->
             ok;