Skip to content

Commit 13608bd

Browse files
jeremie6windmichalvasko
authored andcommitted
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: 5391a73 Signed-off-by: Jeremie Leska <[email protected]>
1 parent 20fad2b commit 13608bd

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ option(NETOPEER2_LIB_TESTS "Include server tests in netopeer2 library" ON)
8080
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.")
8181
set(THREAD_COUNT 3 CACHE STRING "Number of threads accepting new sessions and handling requests")
8282
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")
83+
set(PS_BACKOFF_SLEEP 30 CACHE STRING "Timeout in milliseconds of polling sessions backoff sleep")
84+
8385
set(YANG_MODULE_DIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATADIR}/yang/modules/netopeer2" CACHE STRING "Directory where to copy the YANG modules to")
8486
set(DATA_DIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATADIR}/netopeer2" CACHE STRING "Directory with shared netopeer2 data")
8587

src/config.h.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
/** @brief Timeout for PS structure accessing in
6060
* case there is too much contention (ms).
6161
*/
62-
#define NP2SRV_PS_BACKOFF_SLEEP 30
62+
#define NP2SRV_PS_BACKOFF_SLEEP @PS_BACKOFF_SLEEP@
6363

6464
/** @brief Sleep time when terminating sub-ntf subscriptions
6565
* to give a chance for another threads to wake up (ms).

0 commit comments

Comments
 (0)