Hi Hans,

On 5/20/2014 1:03 AM, Hans Feldt wrote:
> Not sure I understand the use case for setting NODELAY to false. In the code 
> you have a comment about setting it to true which anyway is the default. So 
> what is the benefit of setting it to false?
[AVM]    I  came across  one requirement where ,user don't want much 
frequent traffic in network , and doesn't bother about performance .
> Since dtm is a system wide messaging service it will affect all services for 
> example AMFs healtchecks can be delayed sitting in a queue somewhere...
  [AVM]  Opnesaf  was working  NODELAY to false previously , we have 
introduced NODELAY to true recently , so their wont be any problem.

-AVM

>
> Thanks,
> Hans
>
>> -----Original Message-----
>> From: [email protected] [mailto:[email protected]]
>> Sent: den 19 maj 2014 06:41
>> To: [email protected]; Hans Feldt
>> Cc: [email protected]
>> Subject: [PATCH 3 of 3] dtm: make TCP_NODELAY set socket option configurable 
>> [#654]
>>
>>   osaf/services/infrastructure/dtms/config/dtmd.conf       |  11 ++++
>>   osaf/services/infrastructure/dtms/dtm/dtm_node_sockets.c |  36 
>> ++++++++--------
>>   osaf/services/infrastructure/dtms/dtm/dtm_read_config.c  |  15 ++++++
>>   osaf/services/infrastructure/dtms/include/dtm_cb.h       |   1 +
>>   4 files changed, 45 insertions(+), 18 deletions(-)
>>
>>
>> Made TCP_NODELAY configurable to specifi whether MDS TCP
>> transport should follow the Nagle algorithm for deciding when to send data.By
>> default, TCP will follow the Nagle algorithm is disable this behavior , can 
>> be
>> configured to TRUE(1) or FALSE(0)
>>
>> Note :This path is on top of Hans Feldt published   on 4-29-2014 10:58 AM.
>>
>> diff --git a/osaf/services/infrastructure/dtms/config/dtmd.conf 
>> b/osaf/services/infrastructure/dtms/config/dtmd.conf
>> --- a/osaf/services/infrastructure/dtms/config/dtmd.conf
>> +++ b/osaf/services/infrastructure/dtms/config/dtmd.conf
>> @@ -85,3 +85,14 @@ DTM_TCP_KEEPALIVE_PROBES=2
>>   #export MDS_SOCK_SND_RCV_BUF_SIZE=16777216
>>   DTM_SOCK_SND_RCV_BUF_SIZE=126976
>>
>> +#
>> +#Specifies whether MDS TCP transport should follow the Nagle algorithm for
>> +#deciding when to send data.By default, TCP will follow the Nagle algorithm 
>> is disable
>> +#this behavior,MDS TCP transport can enable TCP_NODELAY to force
>> +#TCP to always send data immediately.For example,TCP_NODELAY should be used
>> +#when there is an application using TCP for a request/response.
>> +#This option is only supported for sockets with an address family
>> +#of AF_INET or AF_INET6 (internode )and type of SOCK_STREAM
>> +# TRUE(1) or FALSE(0)
>> +DTM_TCP_NODELAY_FLAG=1
>> +
>> diff --git a/osaf/services/infrastructure/dtms/dtm/dtm_node_sockets.c
>> b/osaf/services/infrastructure/dtms/dtm/dtm_node_sockets.c
>> --- a/osaf/services/infrastructure/dtms/dtm/dtm_node_sockets.c
>> +++ b/osaf/services/infrastructure/dtms/dtm/dtm_node_sockets.c
>> @@ -577,12 +577,12 @@ int comm_socket_setup_new(DTM_INTERNODE_
>>              goto done;
>>      }
>>
>> -        int flag = 1;
>> -        if (setsockopt(sock_desc, IPPROTO_TCP, TCP_NODELAY, (void *)&flag, 
>> sizeof(flag)) != 0) {
>> -                LOG_ER("DTM:Socket TCP_NODELAY set failed err :%s", 
>> strerror(errno));
>> -                dtm_comm_socket_close(&sock_desc);
>> -                goto done;
>> -        }
>> +    int flag = dtms_cb->tcp_nodelay_flag;
>> +    if (setsockopt(sock_desc, IPPROTO_TCP, TCP_NODELAY, (void *)&flag, 
>> sizeof(flag)) != 0) {
>> +            LOG_ER("DTM:Socket TCP_NODELAY set failed err :%s", 
>> strerror(errno));
>> +            dtm_comm_socket_close(&sock_desc);
>> +            goto done;
>> +    }
>>
>>      if (NCSCC_RC_SUCCESS != set_keepalive(dtms_cb, sock_desc)) {
>>              LOG_ER("DTM :set_keepalive failed ");
>> @@ -727,12 +727,12 @@ uint32_t dtm_stream_nonblocking_listener
>>              LOG_ER("DTM:Socket snd buf size set failed err :%s", 
>> strerror(errno));
>>      }
>>
>> -        int flag = 1;
>> -        if (setsockopt(dtms_cb->stream_sock, IPPROTO_TCP, TCP_NODELAY, 
>> (void *)&flag, sizeof(flag)) != 0) {
>> -                LOG_ER("DTM:Socket TCP_NODELAY set failed err :%s", 
>> strerror(errno));
>> -                dtm_sockdesc_close(dtms_cb->stream_sock);
>> -                return NCSCC_RC_FAILURE;
>> -        }
>> +    int flag = dtms_cb->tcp_nodelay_flag;
>> +    if (setsockopt(dtms_cb->stream_sock, IPPROTO_TCP, TCP_NODELAY, (void 
>> *)&flag, sizeof(flag)) != 0) {
>> +            LOG_ER("DTM:Socket TCP_NODELAY set failed err :%s", 
>> strerror(errno));
>> +            dtm_sockdesc_close(dtms_cb->stream_sock);
>> +            return NCSCC_RC_FAILURE;
>> +    }
>>
>>      if (set_keepalive(dtms_cb, dtms_cb->stream_sock) != NCSCC_RC_SUCCESS) {
>>              LOG_ER("DTM : set_keepalive() failed");
>> @@ -1296,12 +1296,12 @@ int dtm_process_accept(DTM_INTERNODE_CB
>>              goto done;
>>      }
>>
>> -        int flag = 1;
>> -        if (setsockopt(new_conn_sd, IPPROTO_TCP, TCP_NODELAY, (void 
>> *)&flag, sizeof(flag)) != 0) {
>> -                LOG_ER("DTM:Socket TCP_NODELAY set failed err :%s", 
>> strerror(errno));
>> -                dtm_comm_socket_close(&new_conn_sd);
>> -                goto done;
>> -        }
>> +    int flag = dtms_cb->tcp_nodelay_flag;
>> +    if (setsockopt(new_conn_sd, IPPROTO_TCP, TCP_NODELAY, (void *)&flag, 
>> sizeof(flag)) != 0) {
>> +            LOG_ER("DTM:Socket TCP_NODELAY set failed err :%s", 
>> strerror(errno));
>> +            dtm_comm_socket_close(&new_conn_sd);
>> +            goto done;
>> +    }
>>
>>      if (NCSCC_RC_SUCCESS != set_keepalive(dtms_cb, new_conn_sd)) {
>>              LOG_ER("DTM:set_keepalive failed ");
>> diff --git a/osaf/services/infrastructure/dtms/dtm/dtm_read_config.c 
>> b/osaf/services/infrastructure/dtms/dtm/dtm_read_config.c
>> --- a/osaf/services/infrastructure/dtms/dtm/dtm_read_config.c
>> +++ b/osaf/services/infrastructure/dtms/dtm/dtm_read_config.c
>> @@ -96,6 +96,8 @@ void dtm_print_config(DTM_INTERNODE_CB *
>>      TRACE("  %d", config->bcast_msg_freq);
>>      TRACE("  DTM_SOCK_SND_RCV_BUF_SIZE: ");
>>      TRACE("  %d", config->sock_snd_rcv_buf_size);
>> +    TRACE("  DTM_TCP_NODELAY_FLAG: ");
>> +    TRACE("  %d", config->tcp_nodelay_flag);
>>      TRACE("DTM : ");
>>   }
>>
>> @@ -223,6 +225,7 @@ int dtm_read_config(DTM_INTERNODE_CB * c
>>      config->bcast_msg_freq = BCAST_FRE;
>>      config->initial_dis_timeout = DIS_TIME_OUT;
>>      config->sock_snd_rcv_buf_size = DTM_SOCK_SND_RCV_BUF_SIZE;
>> +    config->tcp_nodelay_flag = true;
>>      config->mcast_flag = false;
>>      config->scope_link = false;
>>      config->node_id = m_NCS_GET_NODE_ID;
>> @@ -439,6 +442,18 @@ int dtm_read_config(DTM_INTERNODE_CB * c
>>                              tag_len = 0;
>>
>>                      }
>> +
>> +                    if (strncmp(line, "DTM_TCP_NODELAY_FLAG=", 
>> strlen("DTM_TCP_NODELAY_FLAG=")) == 0) {
>> +                            tag_len = strlen("DTM_TCP_NODELAY_FLAG=");
>> +                            config->tcp_nodelay_flag = atoi(&line[tag_len]);
>> +                            if (config->tcp_nodelay_flag < 0 || 
>> config->tcp_nodelay_flag > 1) {
>> +                                    LOG_ER("DTM: DTM_TCP_NODELAY_FLAG  
>> needs to be 0 or 1 of dtmd.conf ");
>> +                                    return -1;
>> +                            }
>> +                            tag = 0;
>> +                            tag_len = 0;
>> +
>> +                    }
>>              }
>>
>>              memset(line, 0, DTM_MAX_TAG_LEN);
>> diff --git a/osaf/services/infrastructure/dtms/include/dtm_cb.h 
>> b/osaf/services/infrastructure/dtms/include/dtm_cb.h
>> --- a/osaf/services/infrastructure/dtms/include/dtm_cb.h
>> +++ b/osaf/services/infrastructure/dtms/include/dtm_cb.h
>> @@ -91,6 +91,7 @@ typedef struct dtm_internode_cb {
>>      int comm_keepalive_intvl;
>>      int comm_keepalive_probes;
>>      int32_t sock_snd_rcv_buf_size; /* The value of SO_RCVBUF & SO_SNDBUF */
>> +    uint32_t tcp_nodelay_flag;  /* The value of TCP_NODELAY Flag */
>>      SYSF_MBX mbx;
>>      int mbx_fd;
>>   } DTM_INTERNODE_CB;


------------------------------------------------------------------------------
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.
Get unparalleled scalability from the best Selenium testing platform available
Simple to use. Nothing to install. Get started now for free."
http://p.sf.net/sfu/SauceLabs
_______________________________________________
Opensaf-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

Reply via email to