diff options
| author | yangwei <[email protected]> | 2024-04-12 00:52:43 +0800 |
|---|---|---|
| committer | yangwei <[email protected]> | 2024-04-12 00:52:43 +0800 |
| commit | 020d83f07d272d0d25ea7c4198d74c3ba36b41d5 (patch) | |
| tree | 3fb597a1914c5ae6b2b04b91a172e19a4ec93d69 | |
| parent | 69e4ec7c927526b337a89d0ac6524490a9fc3781 (diff) | |
✨ feat(udp concurrency stream num): add max_opening & max_pair
| -rw-r--r-- | include/private/sapp_global_val.h | 2 | ||||
| -rw-r--r-- | src/config/config_parse.cpp | 2 | ||||
| -rw-r--r-- | src/sapp_dev/sapp_init.c | 2 |
3 files changed, 5 insertions, 1 deletions
diff --git a/include/private/sapp_global_val.h b/include/private/sapp_global_val.h index 0cf0da0..798bc36 100644 --- a/include/private/sapp_global_val.h +++ b/include/private/sapp_global_val.h @@ -120,6 +120,8 @@ typedef struct{ int well_known_ports_array_num; int max_timeouts_per_sec; int max_opening_per_sec; + int max_opening; + int max_pair; }sapp_config_stream_udp_t; diff --git a/src/config/config_parse.cpp b/src/config/config_parse.cpp index 495a621..dd1e010 100644 --- a/src/config/config_parse.cpp +++ b/src/config/config_parse.cpp @@ -1789,6 +1789,8 @@ int sapp_parse_config(void) /******************************* STREAM.UDP ******************************/ tomlc99_wrap_load_int_def(ABBR_CFG_FILE_MAIN_ENTRY, (char *)"stream.udp", (char *)"max", (int *)&pconfig->stream.udp.max, 5000); + tomlc99_wrap_load_int_def(ABBR_CFG_FILE_MAIN_ENTRY, (char *)"stream.udp", (char *)"max_opening", (int *)&pconfig->stream.udp.max_opening, pconfig->stream.udp.max*3); + tomlc99_wrap_load_int_def(ABBR_CFG_FILE_MAIN_ENTRY, (char *)"stream.udp", (char *)"max_pair", (int *)&pconfig->stream.udp.max_pair, pconfig->stream.udp.max); tomlc99_wrap_load_int_def(ABBR_CFG_FILE_MAIN_ENTRY, (char *)"stream.udp", (char *)"timeout", (int *)&pconfig->stream.udp.timeout, 60); tomlc99_wrap_load_int_def(ABBR_CFG_FILE_MAIN_ENTRY, (char *)"stream.udp", (char *)"meaningful_statistics_minimum_pkt", (int *)&pconfig->stream.udp.meaningful_statistics_minimum_pkt, 3); tomlc99_wrap_load_int_def(ABBR_CFG_FILE_MAIN_ENTRY, (char *)"stream.udp", (char *)"meaningful_statistics_minimum_byte", (int *)&pconfig->stream.udp.meaningful_statistics_minimum_byte, 5); diff --git a/src/sapp_dev/sapp_init.c b/src/sapp_dev/sapp_init.c index 9b1f3c6..f6ef015 100644 --- a/src/sapp_dev/sapp_init.c +++ b/src/sapp_dev/sapp_init.c @@ -103,7 +103,7 @@ int MESA_platform_init(int argc, char *argv[]) ipv4_frag_init(g_iThreadNum, 1024 * 512); ipv6_frag_init(g_iThreadNum, 1024 * 256); tcp_set_stream_num(max_tcp_stream_num*3,max_tcp_stream_num,max_tcp_stream_num*2); - udp_set_stream_num(max_udp_stream_num*3,max_udp_stream_num,max_udp_stream_num*2); + udp_set_stream_num(sapp_global_val->config.stream.udp.max_opening,sapp_global_val->config.stream.udp.max_pair,sapp_global_val->config.stream.udp.max); MESA_load_profile_int_def("conf/main.conf","Module", "timedelay_threshold", &int_tmp, 10000000); g_timedelay_threshold = (long long)int_tmp; |
