mirror of
https://github.com/seriyps/mtproto_proxy.git
synced 2026-08-04 15:19:47 +00:00
Tune socket receive buffer sizes to fix false positive backpressure
This commit is contained in:
parent
23ef74a551
commit
efafd37ca9
2 changed files with 5 additions and 0 deletions
|
|
@ -19,6 +19,7 @@ connect(Host, Port, Secret, DcId, Protocol) ->
|
|||
Opts = [{packet, raw},
|
||||
{mode, binary},
|
||||
{active, false},
|
||||
{buffer, 1024},
|
||||
{send_timeout, 5000}],
|
||||
{ok, Sock} = gen_tcp:connect(Host, Port, Opts, 1000),
|
||||
{Header, _, _, CryptoLayer} = mtp_obfuscated:client_create(Secret, Protocol, DcId),
|
||||
|
|
|
|||
|
|
@ -169,6 +169,10 @@ downstream_size_backpressure_case(Cfg) when is_list(Cfg) ->
|
|||
|
||||
%% @doc test downstream backpressure when count of non-acknowledged packets grows above threshold
|
||||
downstream_qlen_backpressure_case({pre, Cfg}) ->
|
||||
application:load(mtproto_proxy),
|
||||
%% Reducing downstream socket buffer size. Otherwise we can get queue overflow from just single
|
||||
%% socket data packet
|
||||
application:set_env(mtproto_proxy, downstream_socket_buffer_size, 1024),
|
||||
Cfg1 = setup_single(?FUNCTION_NAME, ?LINE, #{rpc_handler => mtp_test_cmd_rpc}, Cfg),
|
||||
%% Disable upstream healthchecks
|
||||
application:set_env(?APP, upstream_healthchecks, []),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue