Skip to content

Commit 72a8e18

Browse files
Config: tune some values for ROS use case, especially with large number of Nodes (>200) (#509) (#516)
Co-authored-by: Julien Enoch <[email protected]> Co-authored-by: Yadunund <[email protected]> (cherry picked from commit bab4c93) Co-authored-by: Luca Cominardi <[email protected]>
1 parent 9836e36 commit 72a8e18

File tree

2 files changed

+40
-15
lines changed

2 files changed

+40
-15
lines changed

rmw_zenoh_cpp/config/DEFAULT_RMW_ZENOH_ROUTER_CONFIG.json5

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,10 @@
205205
},
206206

207207
/// The default timeout to apply to queries in milliseconds.
208-
queries_default_timeout: 10000,
208+
/// ROS setting: increase the value to avoid timeout at launch time with a large number of Nodes starting all together.
209+
/// Note: the requests to services and actions are hard-coded with an infinite timeout. Hence, this setting
210+
/// only applies to the queries made by the Advanced Subscriber for TRANSIENT_LOCAL implementation.
211+
queries_default_timeout: 60000,
209212

210213
/// The routing strategy to use and it's configuration.
211214
routing: {
@@ -381,13 +384,17 @@
381384
transport: {
382385
unicast: {
383386
/// Timeout in milliseconds when opening a link
384-
open_timeout: 10000,
387+
/// ROS setting: increase the value to avoid timeout at launch time with a large number of Nodes starting all together
388+
open_timeout: 60000,
385389
/// Timeout in milliseconds when accepting a link
386-
accept_timeout: 10000,
390+
/// ROS setting: increase the value to avoid timeout at launch time with a large number of Nodes starting all together
391+
accept_timeout: 60000,
387392
/// Maximum number of links in pending state while performing the handshake for accepting it
388-
accept_pending: 100,
393+
/// ROS setting: increase the value to support a large number of Nodes starting all together
394+
accept_pending: 10000,
389395
/// Maximum number of transports that can be simultaneously alive for a single zenoh sessions
390-
max_sessions: 1000,
396+
/// ROS setting: increase the value to support a large number of Nodes starting all together
397+
max_sessions: 10000,
391398
/// Maximum number of incoming links that are admitted per transport
392399
max_links: 1,
393400
/// Enables the LowLatency transport
@@ -446,7 +453,8 @@
446453
/// Accepted values: 8bit, 16bit, 32bit, 64bit.
447454
sequence_number_resolution: "32bit",
448455
/// Link lease duration in milliseconds to announce to other zenoh nodes
449-
lease: 10000,
456+
/// ROS setting: increase the value to avoid lease expiration at launch time with a large number of Nodes starting all together
457+
lease: 60000,
450458
/// Number of keep-alive messages in a link lease duration. If no data is sent, keep alive
451459
/// messages will be sent at the configured time interval.
452460
/// NOTE: In order to consider eventual packet loss and transmission latency and jitter,
@@ -456,7 +464,9 @@
456464
/// This is in-line with the ITU-T G.8013/Y.1731 specification on continuous connectivity
457465
/// check which considers a link as failed when no messages are received in 3.5 times the
458466
/// target interval.
459-
keep_alive: 4,
467+
/// ROS setting: decrease the value since Nodes are communicating over the loopback
468+
/// where keep-alive messages have less chances to be lost.
469+
keep_alive: 2,
460470
/// Batch size in bytes is expressed as a 16bit unsigned integer.
461471
/// Therefore, the maximum batch size is 2^16-1 (i.e. 65535).
462472
/// The default batch size value is the maximum batch size: 65535.
@@ -492,6 +502,9 @@
492502
block: {
493503
/// The maximum time in microseconds to wait for an available batch before closing the transport session when sending a blocking message
494504
/// if still no batch is available.
505+
/// ROS setting: unlike DEFAULT_RMW_ZENOH_SESSION_CONFIG.json5, no change here:
506+
/// as the router is routing messages to outside the robot, possibly over WiFi,
507+
/// keeping a lower value ensure the router is not blocked for too long in case of congestioned WiFi.
495508
wait_before_close: 5000000,
496509
},
497510
},

rmw_zenoh_cpp/config/DEFAULT_RMW_ZENOH_SESSION_CONFIG.json5

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,10 @@
215215
},
216216

217217
/// The default timeout to apply to queries in milliseconds.
218-
queries_default_timeout: 10000,
218+
/// ROS setting: increase the value to avoid timeout at launch time with a large number of Nodes starting all together.
219+
/// Note: the requests to services and actions are hard-coded with an infinite timeout. Hence, this setting
220+
/// only applies to the queries made by the Advanced Subscriber for TRANSIENT_LOCAL implementation.
221+
queries_default_timeout: 60000,
219222

220223
/// The routing strategy to use and it's configuration.
221224
routing: {
@@ -389,13 +392,17 @@
389392
transport: {
390393
unicast: {
391394
/// Timeout in milliseconds when opening a link
392-
open_timeout: 10000,
395+
/// ROS setting: increase the value to avoid timeout at launch time with a large number of Nodes starting all together
396+
open_timeout: 60000,
393397
/// Timeout in milliseconds when accepting a link
394-
accept_timeout: 10000,
398+
/// ROS setting: increase the value to avoid timeout at launch time with a large number of Nodes starting all together
399+
accept_timeout: 60000,
395400
/// Maximum number of links in pending state while performing the handshake for accepting it
396-
accept_pending: 100,
401+
/// ROS setting: increase the value to support a large number of Nodes starting all together
402+
accept_pending: 10000,
397403
/// Maximum number of transports that can be simultaneously alive for a single zenoh sessions
398-
max_sessions: 1000,
404+
/// ROS setting: increase the value to support a large number of Nodes starting all together
405+
max_sessions: 10000,
399406
/// Maximum number of incoming links that are admitted per transport
400407
max_links: 1,
401408
/// Enables the LowLatency transport
@@ -454,7 +461,8 @@
454461
/// Accepted values: 8bit, 16bit, 32bit, 64bit.
455462
sequence_number_resolution: "32bit",
456463
/// Link lease duration in milliseconds to announce to other zenoh nodes
457-
lease: 10000,
464+
/// ROS setting: increase the value to avoid lease expiration at launch time with a large number of Nodes starting all together
465+
lease: 60000,
458466
/// Number of keep-alive messages in a link lease duration. If no data is sent, keep alive
459467
/// messages will be sent at the configured time interval.
460468
/// NOTE: In order to consider eventual packet loss and transmission latency and jitter,
@@ -464,7 +472,9 @@
464472
/// This is in-line with the ITU-T G.8013/Y.1731 specification on continuous connectivity
465473
/// check which considers a link as failed when no messages are received in 3.5 times the
466474
/// target interval.
467-
keep_alive: 4,
475+
/// ROS setting: decrease the value since Nodes are communicating over the loopback
476+
/// where keep-alive messages have less chances to be lost.
477+
keep_alive: 2,
468478
/// Batch size in bytes is expressed as a 16bit unsigned integer.
469479
/// Therefore, the maximum batch size is 2^16-1 (i.e. 65535).
470480
/// The default batch size value is the maximum batch size: 65535.
@@ -500,7 +510,9 @@
500510
block: {
501511
/// The maximum time in microseconds to wait for an available batch before closing the transport session when sending a blocking message
502512
/// if still no batch is available.
503-
wait_before_close: 5000000,
513+
/// ROS setting: increase the value to avoid unecessary link closure at launch time where congestion is likely
514+
/// to occur even over the loopback since all the Nodes are starting at the same time.
515+
wait_before_close: 60000000,
504516
},
505517
},
506518
/// Perform batching of messages if they are smaller of the batch_size

0 commit comments

Comments
 (0)