From d906ced5c3b23e22ccb29308b1d3d34f5717efd4 Mon Sep 17 00:00:00 2001 From: winlin Date: Thu, 16 Apr 2020 14:13:09 +0800 Subject: [PATCH] For #307, set cache to about 1.4GB when clients is 2k --- trunk/src/core/srs_core_performance.hpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/trunk/src/core/srs_core_performance.hpp b/trunk/src/core/srs_core_performance.hpp index cbfddf1dc..6958aed4f 100644 --- a/trunk/src/core/srs_core_performance.hpp +++ b/trunk/src/core/srs_core_performance.hpp @@ -193,7 +193,15 @@ #undef SRS_PERF_GLIBC_MEMORY_CHECK // For RTC, how many iovs we alloc for each mmsghdr for GSO. -#define SRS_PERF_RTC_GSO_IOVS 4 +// Assume that there are 2400 clients, say, 60000 msgs in queue to send, the memory is: +// 2 # We have two queue, cache and hotspot. +// * 4 # We have reuseport, each have msg cache queue. +// * (64 + SRS_PERF_RTC_GSO_IOVS * 1500) # Each message size. +// * 60000 # Total messages. +// = 715MB # For SRS_PERF_RTC_GSO_IOVS = 1 +// = 1402MB # For SRS_PERF_RTC_GSO_IOVS = 2 +// = 2775MB # For SRS_PERF_RTC_GSO_IOVS = 4 +#define SRS_PERF_RTC_GSO_IOVS 2 #endif