From e2ad198f33e6e3e8b229f58ffc8fefad58296d47 Mon Sep 17 00:00:00 2001 From: Angus Gratton Date: Tue, 28 Nov 2023 09:42:52 +1100 Subject: [PATCH] esp32/sdkconfig: Shorten LWIP MSL period to 10 seconds. Default MSL is 60 seconds. The main purpose of this is to shorten time closed sockets spend in the TIME_WAIT state. This is (2 * MSL) so previously 2 minutes, with this change becomes 20 seconds. Without this, a system which makes many short-lived TCP connections can grow to be holding hundreds of sockets in TIME_WAIT. Possible fix for https://github.com/micropython/micropython/issues/12819 This work was funded through GitHub Sponsors. Signed-off-by: Angus Gratton --- ports/esp32/boards/sdkconfig.base | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ports/esp32/boards/sdkconfig.base b/ports/esp32/boards/sdkconfig.base index 2a7c9a1c5b8c..eefa8286f696 100644 --- a/ports/esp32/boards/sdkconfig.base +++ b/ports/esp32/boards/sdkconfig.base @@ -51,10 +51,11 @@ CONFIG_FREERTOS_THREAD_LOCAL_STORAGE_POINTERS=2 CONFIG_FREERTOS_SUPPORT_STATIC_ALLOCATION=y CONFIG_FREERTOS_ENABLE_STATIC_TASK_CLEAN_UP=y -# UDP +# LWIP CONFIG_LWIP_PPP_SUPPORT=y CONFIG_LWIP_PPP_PAP_SUPPORT=y CONFIG_LWIP_PPP_CHAP_SUPPORT=y +CONFIG_LWIP_TCP_MSL=10000 # SSL # Use 4kiB output buffer instead of default 16kiB