[{emqx,
  [{trie_compaction,true},
   {route_lock_type,key},
   {route_batch_clean,false},
   {shared_dispatch_ack_enabled,false},
   {shared_subscription_strategy,random},
   {session_locking_strategy,quorum},
   {enable_session_registry,true},
   {broker_sys_heartbeat,30000},
   {broker_sys_interval,60000},
   {expand_plugins_dir,"etc/plugins/"},
   {plugins_loaded_file,"data/loaded_plugins"},
   {plugins_etc_dir,"etc/plugins/"},
   {modules_loaded_file,"data/loaded_modules"},
   {strict_mode,false},
   {ignore_loop_deliver,false},
   {shared_subscription,true},
   {wildcard_subscription,true},
   {retain_available,true},
   {max_topic_alias,65535},
   {max_qos_allowed,2},
   {max_topic_levels,128},
   {max_clientid_len,65535},
   {max_packet_size,1048576},
   {acl_deny_action,ignore},
   {acl_cache_max_size,32},
   {acl_cache_ttl,60000},
   {enable_acl_cache,true},
   {acl_file,"etc/acl.conf"},
   {acl_nomatch,allow},
   {allow_anonymous,true},
   {rpc_mode,async},
   {backtrace_depth,16},
   {global_gc_interval,900},
   {data_dir,"data"},
   {flapping_detect_policy,
    #{banned_interval => 300,duration => 60000,threshold => 30}},
   {zones,
    [{external,
      [{use_username_as_clientid,false},
       {upgrade_qos,false},
       {strict_mode,false},
       {session_expiry_interval,7200},
       {retry_interval,30},
       {mqueue_store_qos0,true},
       {mqueue_priorities,none},
       {mqueue_default_priority,highest},
       {max_subscriptions,0},
       {max_mqueue_len,1000},
       {max_inflight,32},
       {max_awaiting_rel,100},
       {keepalive_backoff,0.75},
       {ignore_loop_deliver,false},
       {idle_timeout,15000},
       {force_shutdown_policy,
        #{max_heap_size => 8388608,message_queue_len => 10000}},
       {force_gc_policy,#{bytes => 16777216,count => 16000}},
       {enable_stats,true},
       {enable_flapping_detect,false},
       {enable_ban,true},
       {enable_acl,true},
       {conn_congestion_min_alarm_sustain_duration,60000},
       {conn_congestion_alarm_enabled,false},
       {bypass_auth_plugins,false},
       {await_rel_timeout,300},
       {acl_deny_action,ignore}]},
     {internal,
      [{use_username_as_clientid,false},
       {upgrade_qos,false},
       {strict_mode,false},
       {session_expiry_interval,7200},
       {retry_interval,30},
       {mqueue_store_qos0,true},
       {mqueue_priorities,none},
       {mqueue_default_priority,lowest},
       {max_subscriptions,0},
       {max_mqueue_len,10000},
       {max_inflight,128},
       {max_awaiting_rel,1000},
       {keepalive_backoff,0.75},
       {ignore_loop_deliver,false},
       {idle_timeout,15000},
       {force_shutdown_policy,
        #{max_heap_size => 8388608,message_queue_len => 10000}},
       {enable_stats,true},
       {enable_flapping_detect,false},
       {enable_ban,false},
       {enable_acl,false},
       {conn_congestion_min_alarm_sustain_duration,60000},
       {conn_congestion_alarm_enabled,false},
       {bypass_auth_plugins,true},
       {await_rel_timeout,300},
       {allow_anonymous,true},
       {acl_deny_action,ignore}]}]},
   {listeners,
    [#{listen_on => {{127,0,0,1},11883},
       name => "internal",
       opts =>
        [{deflate_options,[]},
         {tcp_options,
          [{backlog,512},
           {send_timeout,5000},
           {send_timeout_close,true},
           {recbuf,65536},
           {sndbuf,65536},
           {high_watermark,1048576},
           {nodelay,false},
           {reuseaddr,true}]},
         {acceptors,4},
         {max_connections,1024000},
         {max_conn_rate,1000},
         {active_n,1000},
         {zone,internal},
         {proxy_address_header,<<>>},
         {proxy_port_header,<<>>},
         {supported_subprotocols,[]}],
       proto => tcp},
     #{listen_on => {{0,0,0,0},1883},
       name => "external",
       opts =>
        [{deflate_options,[]},
         {tcp_options,
          [{backlog,1024},
           {send_timeout,15000},
           {send_timeout_close,true},
           {high_watermark,1048576},
           {nodelay,true},
           {reuseaddr,true}]},
         {acceptors,8},
         {max_connections,1024000},
         {max_conn_rate,1000},
         {active_n,100},
         {zone,external},
         {proxy_address_header,<<>>},
         {proxy_port_header,<<>>},
         {supported_subprotocols,[]},
         {access_rules,[{allow,all}]}],
       proto => tcp},
     #{listen_on => 8083,name => "external",
       opts =>
        [{deflate_options,[]},
         {tcp_options,
          [{backlog,1024},
           {send_timeout,15000},
           {send_timeout_close,true},
           {nodelay,true}]},
         {acceptors,4},
         {mqtt_path,"/mqtt"},
         {max_connections,102400},
         {max_conn_rate,1000},
         {active_n,100},
         {zone,external},
         {proxy_address_header,<<"x-forwarded-for">>},
         {proxy_port_header,<<"x-forwarded-port">>},
         {fail_if_no_subprotocol,true},
         {supported_subprotocols,["mqtt","mqtt-v3","mqtt-v3.1.1","mqtt-v5"]},
         {mqtt_piggyback,multiple},
         {check_origin_enable,false},
         {allow_origin_absence,true},
         {check_origins,
          [<<"http://localhost:18083">>,<<"http://127.0.0.1:18083">>]},
         {access_rules,[{allow,all}]}],
       proto => ws},
     #{listen_on => 8883,name => "external",
       opts =>
        [{deflate_options,[]},
         {tcp_options,
          [{backlog,1024},
           {send_timeout,15000},
           {send_timeout_close,true},
           {high_watermark,1048576},
           {nodelay,true},
           {reuseaddr,true}]},
         {ssl_options,
          [{ciphers,
            ["TLS_AES_256_GCM_SHA384","TLS_AES_128_GCM_SHA256",
             "TLS_CHACHA20_POLY1305_SHA256","TLS_AES_128_CCM_SHA256",
             "TLS_AES_128_CCM_8_SHA256","ECDHE-ECDSA-AES256-GCM-SHA384",
             "ECDHE-RSA-AES256-GCM-SHA384","ECDHE-ECDSA-AES256-SHA384",
             "ECDHE-RSA-AES256-SHA384","ECDHE-ECDSA-DES-CBC3-SHA",
             "ECDH-ECDSA-AES256-GCM-SHA384","ECDH-RSA-AES256-GCM-SHA384",
             "ECDH-ECDSA-AES256-SHA384","ECDH-RSA-AES256-SHA384",
             "DHE-DSS-AES256-GCM-SHA384","DHE-DSS-AES256-SHA256",
             "AES256-GCM-SHA384","AES256-SHA256",
             "ECDHE-ECDSA-AES128-GCM-SHA256","ECDHE-RSA-AES128-GCM-SHA256",
             "ECDHE-ECDSA-AES128-SHA256","ECDHE-RSA-AES128-SHA256",
             "ECDH-ECDSA-AES128-GCM-SHA256","ECDH-RSA-AES128-GCM-SHA256",
             "ECDH-ECDSA-AES128-SHA256","ECDH-RSA-AES128-SHA256",
             "DHE-DSS-AES128-GCM-SHA256","DHE-DSS-AES128-SHA256",
             "AES128-GCM-SHA256","AES128-SHA256","ECDHE-ECDSA-AES256-SHA",
             "ECDHE-RSA-AES256-SHA","DHE-DSS-AES256-SHA",
             "ECDH-ECDSA-AES256-SHA","ECDH-RSA-AES256-SHA","AES256-SHA",
             "ECDHE-ECDSA-AES128-SHA","ECDHE-RSA-AES128-SHA",
             "DHE-DSS-AES128-SHA","ECDH-ECDSA-AES128-SHA",
             "ECDH-RSA-AES128-SHA","AES128-SHA"]},
           {handshake_timeout,15000},
           {depth,10},
           {keyfile,"etc/certs/key.pem"},
           {certfile,"etc/certs/cert.pem"},
           {reuse_sessions,true}]},
         {acceptors,16},
         {max_connections,102400},
         {max_conn_rate,500},
         {active_n,100},
         {zone,external},
         {proxy_address_header,<<>>},
         {proxy_port_header,<<>>},
         {supported_subprotocols,[]},
         {access_rules,[{allow,all}]}],
       proto => ssl},
     #{listen_on => 8084,name => "external",
       opts =>
        [{deflate_options,[]},
         {tcp_options,
          [{backlog,1024},
           {send_timeout,15000},
           {send_timeout_close,true},
           {nodelay,true}]},
         {ssl_options,
          [{ciphers,
            ["TLS_AES_256_GCM_SHA384","TLS_AES_128_GCM_SHA256",
             "TLS_CHACHA20_POLY1305_SHA256","TLS_AES_128_CCM_SHA256",
             "TLS_AES_128_CCM_8_SHA256","ECDHE-ECDSA-AES256-GCM-SHA384",
             "ECDHE-RSA-AES256-GCM-SHA384","ECDHE-ECDSA-AES256-SHA384",
             "ECDHE-RSA-AES256-SHA384","ECDHE-ECDSA-DES-CBC3-SHA",
             "ECDH-ECDSA-AES256-GCM-SHA384","ECDH-RSA-AES256-GCM-SHA384",
             "ECDH-ECDSA-AES256-SHA384","ECDH-RSA-AES256-SHA384",
             "DHE-DSS-AES256-GCM-SHA384","DHE-DSS-AES256-SHA256",
             "AES256-GCM-SHA384","AES256-SHA256",
             "ECDHE-ECDSA-AES128-GCM-SHA256","ECDHE-RSA-AES128-GCM-SHA256",
             "ECDHE-ECDSA-AES128-SHA256","ECDHE-RSA-AES128-SHA256",
             "ECDH-ECDSA-AES128-GCM-SHA256","ECDH-RSA-AES128-GCM-SHA256",
             "ECDH-ECDSA-AES128-SHA256","ECDH-RSA-AES128-SHA256",
             "DHE-DSS-AES128-GCM-SHA256","DHE-DSS-AES128-SHA256",
             "AES128-GCM-SHA256","AES128-SHA256","ECDHE-ECDSA-AES256-SHA",
             "ECDHE-RSA-AES256-SHA","DHE-DSS-AES256-SHA",
             "ECDH-ECDSA-AES256-SHA","ECDH-RSA-AES256-SHA","AES256-SHA",
             "ECDHE-ECDSA-AES128-SHA","ECDHE-RSA-AES128-SHA",
             "DHE-DSS-AES128-SHA","ECDH-ECDSA-AES128-SHA",
             "ECDH-RSA-AES128-SHA","AES128-SHA"]},
           {depth,10},
           {keyfile,"etc/certs/key.pem"},
           {certfile,"etc/certs/cert.pem"},
           {reuse_sessions,true}]},
         {acceptors,4},
         {mqtt_path,"/mqtt"},
         {max_connections,102400},
         {max_conn_rate,1000},
         {active_n,100},
         {zone,external},
         {proxy_address_header,<<"x-forwarded-for">>},
         {proxy_port_header,<<"x-forwarded-port">>},
         {fail_if_no_subprotocol,true},
         {supported_subprotocols,["mqtt","mqtt-v3","mqtt-v3.1.1","mqtt-v5"]},
         {mqtt_piggyback,multiple},
         {check_origin_enable,false},
         {allow_origin_absence,true},
         {check_origins,
          [<<"https://localhost:8084">>,<<"https://127.0.0.1:8084">>]},
         {access_rules,[{allow,all}]}],
       proto => wss}]},
   {modules,
    [{emqx_mod_presence,[{qos,1}]},
     {emqx_mod_subscription,[]},
     {emqx_mod_rewrite,[]},
     {emqx_mod_topic_metrics,[]},
     {emqx_mod_delayed,[]},
     {emqx_mod_acl_internal,[{acl_file,"etc/acl.conf"}]}]},
   {sysmon,
    [{long_schedule,240},
     {long_gc,0},
     {large_heap,8388608},
     {busy_port,false},
     {busy_dist_port,true}]},
   {os_mon,
    [{cpu_check_interval,60},
     {cpu_high_watermark,80.0},
     {cpu_low_watermark,60.0},
     {mem_check_interval,60},
     {sysmem_high_watermark,70.0},
     {procmem_high_watermark,5.0}]},
   {vm_mon,
    [{check_interval,30},
     {process_high_watermark,80.0},
     {process_low_watermark,60.0}]},
   {alarm,[{actions,[log,publish]},{size_limit,1000},{validity_period,86400}]},
   {telemetry,
    [{enabled,false},
     {url,"https://telemetry-emqx-io.bigpar.vercel.app/api/telemetry"},
     {report_interval,604800}]}]},
 {kernel,
  [{error_logger,silent},
   {error_logger_format_depth,100},
   {inet_dist_listen_max,6369},
   {inet_dist_listen_min,6369},
   {logger_level,warning},
   {logger,
    [{handler,default,undefined},
     {handler,file,logger_disk_log_h,
      #{config =>
         #{burst_limit_enable => false,burst_limit_max_count => 20000,
           burst_limit_window_time => 1000,drop_mode_qlen => 3000,
           file => "log/emqx.log",flush_qlen => 8000,max_no_bytes => 10485760,
           max_no_files => 5,overload_kill_enable => true,
           overload_kill_mem_size => 31457280,overload_kill_qlen => 20000,
           overload_kill_restart_after => 5000,sync_mode_qlen => 100,
           type => wrap},
        filesync_repeat_interval => no_repeat,
        filters =>
         [{drop_progress_reports,{fun logger_filters:progress/2,stop}}],
        formatter =>
         {emqx_logger_textfmt,
          #{chars_limit => unlimited,single_line => true,
            template =>
             [time," [",level,"] ",
              {clientid,
               [{peername,[clientid,"@",peername," "],[clientid," "]}],
               [{peername,[peername," "],[]}]},
              msg,"\n"]}},
        level => warning}}]}]},
 {gen_rpc,
  [{socket_buffer,1048576},
   {socket_recbuf,1048576},
   {socket_sndbuf,1048576},
   {socket_keepalive_count,9},
   {socket_keepalive_interval,75},
   {socket_keepalive_idle,900},
   {call_receive_timeout,15000},
   {authentication_timeout,5000},
   {send_timeout,5000},
   {connect_timeout,5000},
   {tcp_server_port,5369},
   {port_discovery,stateless},
   {max_batch_size,256},
   {tcp_client_num,1},
   {tcp_client_port,5369}]},
 {ekka,
  [{proto_dist,inet_tcp},
   {cluster_autoheal,true},
   {cluster_autoclean,300000},
   {cluster_name,emqxcl},
   {cluster_discovery,{manual,[]}}]}].
