Skip to content

Commit

Permalink
Limit thread count in router config and add note to configs
Browse files Browse the repository at this point in the history
Signed-off-by: Yadunund <[email protected]>
  • Loading branch information
Yadunund committed Jan 22, 2024
1 parent 6a7a918 commit ec36e0f
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
9 changes: 8 additions & 1 deletion rmw_zenoh_cpp/config/DEFAULT_RMW_ZENOH_ROUTER_CONFIG.json5
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,14 @@
backoff: 100,
// Number of threads dedicated to transmission
// By default, the number of threads is calculated as follows: 1 + ((#cores - 1) / 4)
// threads: 4,
// We limit the number of threads that the zenoh session can spin to 1.
// Without this limit, applications with multiple zenoh sessions can
// encounter system resource errors when trying to create new threads.
// Once zenoh migrates to relying on tokio for its async runtime,
// see https://github.com/eclipse-zenoh/zenoh/pull/566, we can consider
// removing these flags since with tokio, zenoh can better manage the threads it spins
// with the help of thread pools.
threads: 1,
},
},
/// Configure the zenoh RX parameters of a link
Expand Down
7 changes: 7 additions & 0 deletions rmw_zenoh_cpp/config/DEFAULT_RMW_ZENOH_SESSION_CONFIG.json5
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,13 @@
},
// Number of threads dedicated to transmission
// By default, the number of threads is calculated as follows: 1 + ((#cores - 1) / 4)
// We limit the number of threads that the zenoh session can spin to 1.
// Without this limit, applications with multiple zenoh sessions can
// encounter system resource errors when trying to create new threads.
// Once zenoh migrates to relying on tokio for its async runtime,
// see https://github.com/eclipse-zenoh/zenoh/pull/566, we can consider
// removing these flags since with tokio, zenoh can better manage the threads it spins
// with the help of thread pools.
threads: 1,
},
/// Configure the zenoh RX parameters of a link
Expand Down
3 changes: 2 additions & 1 deletion zenoh_c_vendor/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ find_package(ament_cmake_vendor_package REQUIRED)
# the zenoh session can spin via the session config as well as the ASYNC_STD_THREAD_COUNT
# environment variable. Without this limit, applications with multiple zenoh sessions can
# encounter system resource errors when trying to create new threads.
# Once zenoh migrates to relying on tokio for its async runtime, we can consider
# Once zenoh migrates to relying on tokio for its async runtime,
# see https://github.com/eclipse-zenoh/zenoh/pull/566, we can consider
# removing these flags since with tokio, zenoh can better manage the threads it spins
# with the help of thread pools.
# Note: We separate the two args needed for cargo with "$<SEMICOLON>" and not ";" as the
Expand Down

0 comments on commit ec36e0f

Please sign in to comment.