Sfoglia il codice sorgente

Add options for gen_rpc

terry-xiaoyu 6 anni fa
parent
commit
b61d72cdcd
2 ha cambiato i file con 49 aggiunte e 0 eliminazioni
  1. 20 0
      etc/emqx.conf
  2. 29 0
      priv/emqx.schema

+ 20 - 0
etc/emqx.conf

@@ -303,6 +303,11 @@ rpc.tcp_server_port = 5369
 ## Value: Port [1024-65535]
 rpc.tcp_client_port = 5369
 
+## Number of utgoing RPC connections.
+##
+## Value: Interger [1-256]
+rpc.tcp_client_num = 32
+
 ## RCP Client connect timeout.
 ##
 ## Value: Seconds
@@ -338,6 +343,21 @@ rpc.socket_keepalive_interval = 75s
 ## Value: Integer
 rpc.socket_keepalive_count = 9
 
+## Size of TCP send buffer.
+##
+## Value: Bytes
+rpc.socket_sndbuf = 1MB
+
+## Size of TCP receive buffer.
+##
+## Value: Seconds
+rpc.socket_recbuf = 1MB
+
+## Size of user-level software socket buffer.
+##
+## Value: Seconds
+rpc.socket_buffer = 1MB
+
 ##--------------------------------------------------------------------
 ## Log
 ##--------------------------------------------------------------------

+ 29 - 0
priv/emqx.schema

@@ -350,6 +350,13 @@ end}.
   {datatype, integer}
 ]}.
 
+%% Default TCP port for outgoing connections
+{mapping, "rpc.tcp_client_num", "gen_rpc.tcp_client_num", [
+  {default, 32},
+  {datatype, integer},
+  {validators, ["range:gt_0_lt_256"]}
+]}.
+
 %% Client connect timeout
 {mapping, "rpc.connect_timeout", "gen_rpc.connect_timeout", [
   {default, "5s"},
@@ -392,6 +399,28 @@ end}.
   {datatype, integer}
 ]}.
 
+%% Size of TCP send buffer
+{mapping, "rpc.socket_sndbuf", "gen_rpc.socket_sndbuf", [
+  {default, "1MB"},
+  {datatype, bytesize}
+]}.
+
+%% Size of TCP receive buffer
+{mapping, "rpc.socket_recbuf", "gen_rpc.socket_recbuf", [
+  {default, "1MB"},
+  {datatype, bytesize}
+]}.
+
+%% Size of TCP receive buffer
+{mapping, "rpc.socket_buffer", "gen_rpc.socket_buffer", [
+  {default, "1MB"},
+  {datatype, bytesize}
+]}.
+
+{validator, "range:gt_0_lt_256", "must greater than 0 and less than 256",
+  fun(X) -> X > 0 andalso X < 256 end
+}.
+
 %%--------------------------------------------------------------------
 %% Log
 %%--------------------------------------------------------------------