150ms to send an image: is it normal?

3 posts / 0 new
Last post
Offline
Last seen: 4 years 10 months ago
Joined: 01/26/2016
Posts: 11
150ms to send an image: is it normal?

Hi,


I am working on a programme that exchange images between different processes. I am using the builtin profile "BuiltinQosLibExp::Generic.StrictReliable.LargeData.FastFlow" which is tuned to send large data.

My images are ~2500*3000 pixels. I obtain a framerate of ~6fps between 2 processes (same computer). My idl file is:

 

const long         MAX_PIXELS_SEQUENCE_LENGTH    = 7500000;

struct Image {
   sequence<unsigned short, MAX_PIXELS_SEQUENCE_LENGTH>        pixels;
};

 

Do you think that 150ms to send a 2500*3000 image is normal, or do you know what parameters in the QoS I can modify to improve it?

Thanks !

Lucie

Gerardo Pardo's picture
Offline
Last seen: 3 weeks 1 day ago
Joined: 06/02/2010
Posts: 601

Hi Lucie,

This is what is to be expected from the profile "BuiltinQosLibExp::Generic.StrictReliable.LargeData.FastFlow" that you mention you are using.

This profile is setting a flow controller that releases 128 tokens each of 8KB with a period of 10 msec. So this will give you  128*8192*8/0.010 ~= 840 Mbits/sec.

Your image has 7.5M pixels each being 2 bytes. So that is 15M Bytes =120M bits. It is taking 150 msec so you are getting a bandwidth of 800 Mbits/sec which is reasonably close to what the flow controller is regulating to considering there some overhead.

I think 800 Mbit/sec is pretty reasonable if you are running on 1 Gbit ethernet which has a maximum theoretical bandwith of 1000 Mbits/sec. If you pushed it much harder you would be leaving very little bandwidth for other flows which may not be what you want.

But if you are on shared memory or a faster network then you can definitely tune the FlowController to regulate to a higher bandwidth.

If you want to push it harder you would need to configure the flow controller to produce tokens with a faster period, or more tokens per period, or larger tokens. You can do that by creating a new Qos profile that inherits from the "BuiltinQosLibExp::Generic.StrictReliable.LargeData.FastFlow"  define a custom FlowController providing the desired values for the FlowController parameters:

   <qos_profile name="MyLargeImageProfile" base_name="Generic.StrictReliable.LargeData.FastFlow">
     <participant_qos>
        <property>
          <value>
            <!-- The next set of parameters define a flow controller that can be selected  
                 for individual DataWriters. The configurations differ only in the amount of 
                 tokens added and allowed per period 
            <!-- 140 tokens, 8KB per token, 0.01 sec period gives (917 Mb/sec) flow controller -->
            <element>
              <name>dds.flow_controller.token_bucket.large_image_flow.token_bucket.max_tokens</name>
              <value>140</value>
            </element>
            <element>
              <name>dds.flow_controller.token_bucket.large_image_flow.token_bucket.tokens_added_per_period</name>
              <value>128</value>
            </element>
            <element>
              <name>dds.flow_controller.token_bucket.large_image_flow.token_bucket.bytes_per_token</name>
              <value>8192</value>
            </element>
            <element>
              <name>dds.flow_controller.token_bucket.large_image_flow.token_bucket.period.sec</name>
              <value>0</value>
            </element>
            <element>
              <name>dds.flow_controller.token_bucket.large_image_flow.token_bucket.period.nanosec</name>
              <value>10000000</value>
            </element>
          </value>
        </property>
      </participant_qos>
      
      <datawriter_qos>
        <publish_mode>
          <flow_controller_name>dds.flow_controller.token_bucket.large_image_flow</flow_controller_name>
        </publish_mode>
      </datawriter_qos>
      
    </qos_profile>

 

You can read more about what these parameters mean in the Connext DDS User's Manual. See the section titled Creating and Configuring Custom FlowControllers with Property QoS. 

-Gerardo

Offline
Last seen: 4 years 10 months ago
Joined: 01/26/2016
Posts: 11

Hi,

Thank you for your answer, that was exactly what I needed.
 I tuned these parameters and was able to send my images in only 30ms, that's what was required.

 Lucie