From 1828542526284c1ad07395e8d54d5711a711848f Mon Sep 17 00:00:00 2001 From: Jeremie Leska Date: Fri, 31 Jan 2025 17:15:57 +0100 Subject: [PATCH] server UPDATE make thread and poll configurable Since the commit in the link, some performance issues could be observed. Make the thread count and sleep times configurable to avoid this. Link: https://github.com/CESNET/netopeer2/commit/5391a73bf27b4878f981bf8a474e206cd2d212c3 Signed-off-by: Jeremie Leska --- CMakeLists.txt | 2 ++ src/config.h.in | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 75bd07a2..63c40422 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -80,6 +80,8 @@ option(NETOPEER2_LIB_TESTS "Include server tests in netopeer2 library" ON) set(SSH_AUTHORIZED_KEYS_FORMAT "%h/.ssh/authorized_keys" CACHE STRING "sshd-like pattern (with '%h', '%u', '%U') for determining path to users' SSH authorized_keys file.") set(THREAD_COUNT 3 CACHE STRING "Number of threads accepting new sessions and handling requests") set(POLL_IO_TIMEOUT 10 CACHE STRING "Timeout in milliseconds of polling sessions for new data. It is also used for synchronization of low level IO such as sending a reply while a notification is being sent") +set(PS_BACKOFF_SLEEP 30 CACHE STRING "Timeout in milliseconds of polling sessions backoff sleep") + set(YANG_MODULE_DIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATADIR}/yang/modules/netopeer2" CACHE STRING "Directory where to copy the YANG modules to") set(DATA_DIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATADIR}/netopeer2" CACHE STRING "Directory with shared netopeer2 data") diff --git a/src/config.h.in b/src/config.h.in index 19273d38..96f921f7 100644 --- a/src/config.h.in +++ b/src/config.h.in @@ -59,7 +59,7 @@ /** @brief Timeout for PS structure accessing in * case there is too much contention (ms). */ -#define NP2SRV_PS_BACKOFF_SLEEP 30 +#define NP2SRV_PS_BACKOFF_SLEEP @PS_BACKOFF_SLEEP@ /** @brief Sleep time when terminating sub-ntf subscriptions * to give a chance for another threads to wake up (ms).