51.6.1 Setting the Maximum Gather-Send Buffer Count for UDP Transports

To minimize memory copies, Connext uses the "gather send" API that may be available on the transport.

Some operating systems limit the number of gather buffers that can be given to the gather-send function. This limits Connext's ability to concatenate multiple DDS samples into a single network message. An example is the UDP transport's sendmsg() call, which on some OSs (such as Solaris) can only take 16 gather buffers, limiting the number of DDS samples that can be concatenated to five or six.

To match this limitation, Connext sets the UDP transport plug-ins' gather_send_buffer_count_max to 16 by default for all operating systems. This field is part of the NDDS_Transport_Property_t structure.

If you are using an OS that allows more than 16 gather buffers for a sendmsg() call, you may increase the UDP transport plug-in's gather_send_buffer_count_max from the default up to your OS's limit (but no higher than 128).

For example, if your OS imposes a limit of 64 gather buffers, you may increase the gather_send_buffer_count_max up to 64. However, if your OS's gather-buffer limit is 1024, you may only increase the gather_send_buffer_count_max up to 128.

By changing gather_send_buffer_count_max, you can increase performance in the following situations:

  • When a DataWriter is sending multiple packets to a DataReader either because the DataReader is a late-joiner and needs to catch up, or because several packets were dropped by the network or rejected and need to be resent. Changing the setting will help when the DataWriter needs to send or resend more than five or six packets at a time.
  • If your application has more than five or six DataWriters or DataReaders in a participant. (In this case, the change will make the discovery process more efficient.)
  • When using an asynchronous DataWriter, DDS samples are sent asynchronously by a separate thread. DDS samples may not be sent immediately, but may be queued instead, depending on the settings of the associated FlowController. If multiple DDS samples in the queue must be sent to the same destination, they will be coalesced into as few network packets as possible. The number of DDS samples that can be put in a single message is directly proportional to gather_send_buffer_count_max. Therefore, by maximizing gather_send_buffer_count_max, you can minimize the number of packets on the wire.