bouncer/config/sys.config
2022-02-21 11:57:24 +03:00

108 lines
3.4 KiB
Plaintext

[
{bouncer, [
{ip, "::"},
{port, 8022},
{services, #{
arbiter => #{
path => <<"/v1/arbiter">>
}
}},
{protocol_opts, #{
% How much to wait for another request before closing a keepalive connection? (ms)
request_timeout => 5000
}},
{transport_opts, #{
% Maximum number of simultaneous connections. (default = 1024)
max_connections => 8000,
% Size of the acceptor pool. (default = 10)
num_acceptors => 100
}},
% How much to wait for outstanding requests completion when asked to shut down? (ms)
{shutdown_timeout, 1000},
{opa, #{
%% Endpoint of the OPA service
endpoint => {{resolve, dns, "opa", #{pick => random}}, 8181},
% Timeout for making request and receiving response. (ms)
request_timeout => 1000,
%% Pool options, see gunner_pool:pool_opts()
pool_opts => #{
event_handler => {bouncer_gunner_metrics_event_h, #{}},
cleanup_interval => 1000,
max_connection_load => 1,
max_connection_idle_age => 2000,
max_size => 200,
min_size => 5,
connection_opts => #{
% Which transport to use? (tcp | tls)
transport => tcp,
% Which `gen_tcp:connect_option()`s to use? Relevant only for `tcp` transport.
tcp_opts => [inet6],
% Which `ssl:tls_client_option()`s to use? Relevant only for `tls` transport.
tls_opts => [{verify, verify_peer}],
% Total timeout for estabilishing a connection. (ms)
connect_timeout => 1000,
% Timeout for domain lookup query. (ms)
domain_lookup_timeout => 1000
}
}
}},
{woody_event_handlers, [
hay_woody_event_handler,
{scoper_woody_event_handler, #{
event_handler_opts => #{
formatter_opts => #{
max_length => 1000,
max_printable_string_length => 80
}
}
}}
]},
{health_check, #{
% disk => {erl_health, disk , ["/", 99]},
% memory => {erl_health, cg_memory, [99]},
% service => {erl_health, service , [<<"bouncer">>]}
}}
]},
{kernel, [
{logger_level, debug},
{logger, [
{handler, default, logger_std_h, #{
config => #{
type => {file, "/var/log/bouncer/log.json"}
},
formatter => {logger_logstash_formatter, #{}}
}}
]}
]},
{how_are_you, [
{metrics_publishers, [
{hay_statsd_publisher, #{
key_prefix => <<"bouncer.">>,
host => "localhost",
port => 8125
}}
]}
]},
{scoper, [
{storage, scoper_storage_logger}
]},
{snowflake, [
{max_backward_clock_moving, 1000} % 1 second
% {machine_id, hostname_hash}
]},
{prometheus, [
{collectors, [default]}
]}
].