6 Replies Latest reply on Dec 15, 2008 5:23 AM by nachiket_patel

    Using TCP, Unable to reconnect. Don't know why?

    nachiket_patel

      Hello,
      I have changed my communication from UDP to TCP, But when i diconnect and connect again, My application instances(2) does not get connected automatically but if i change back to UDP then it does.

      Snapshot of Configuration:


      <TCP start_port="7800"/>
      <TCPPING timeout="3000" initial_hosts="${jgroups.tcpping.initial_hosts:150.0.149.105[7800]}"
      port_range="1"
      num_initial_members="1"/>

      <FD_SOCK num_tries="3" suspect_msg_interval="3000"/>
      <FD timeout="3000" max_tries="4" shun="false"/>
      <VERIFY_SUSPECT timeout="1500"/>

      <pbcast.NAKACK max_xmit_size="60000"
      use_mcast_xmit="false" gc_lag="0"
      retransmit_timeout="300,600,1200,2400,4800"
      discard_delivered_msgs="true"/>

      <pbcast.STABLE stability_delay="1000" desired_avg_gossip="20000"
      max_bytes="400000"/>

      <pbcast.GMS print_local_addr="true" join_timeout="3000"
      shun="true" view_bundling="true" view_ack_collection_timeout="2000"/>

      <pbcast.STREAMING_STATE_TRANSFER use_reading_thread="true"/>

      <!-- <pbcast.STATE_TRANSFER/> -->
      <pbcast.FLUSH timeout="0"/>

      <MERGE2 max_interval="30000" min_interval="10000"/>


      <FRAG2 frag_size="60000"/>

        • 1. Re: Using TCP, Unable to reconnect. Don't know why?
          belaban

          MERGE2 is in the wrong place. UNICAST is missing, TCP.loopback should be true. Where did you get this config from ?

          Here's a correct config (from 2.7 though):

          <UDP
          mcast_addr="${jgroups.udp.mcast_addr:232.10.10.10}"
          mcast_port="${jgroups.udp.mcast_port:45588}"
          tos="8"
          ucast_recv_buf_size="20000000"
          ucast_send_buf_size="640000"
          mcast_recv_buf_size="25000000"
          mcast_send_buf_size="640000"
          loopback="false"
          discard_incompatible_packets="true"
          max_bundle_size="64000"
          max_bundle_timeout="30"
          ip_ttl="${jgroups.udp.ip_ttl:2}"
          enable_bundling="true"
          enable_diagnostics="true"
          thread_naming_pattern="cl"

          thread_pool.enabled="true"
          thread_pool.min_threads="2"
          thread_pool.max_threads="8"
          thread_pool.keep_alive_time="5000"
          thread_pool.queue_enabled="true"
          thread_pool.queue_max_size="10000"
          thread_pool.rejection_policy="discard"

          oob_thread_pool.enabled="true"
          oob_thread_pool.min_threads="1"
          oob_thread_pool.max_threads="8"
          oob_thread_pool.keep_alive_time="5000"
          oob_thread_pool.queue_enabled="false"
          oob_thread_pool.queue_max_size="100"
          oob_thread_pool.rejection_policy="Run"/>

          <PING timeout="2000"
          num_initial_members="3"/>
          <MERGE2 max_interval="30000"
          min_interval="10000"/>
          <FD_SOCK/>
          <FD_ALL/>
          <VERIFY_SUSPECT timeout="1500" />

          <pbcast.NAKACK use_stats_for_retransmission="false"
          exponential_backoff="150"
          use_mcast_xmit="true" gc_lag="0"
          retransmit_timeout="50,300,600,1200"
          discard_delivered_msgs="true"/>

          <pbcast.STABLE stability_delay="1000" desired_avg_gossip="50000"
          max_bytes="1000000"/>
          <VIEW_SYNC avg_send_interval="60000" />
          <pbcast.GMS print_local_addr="true" join_timeout="3000"
          shun="false"
          view_bundling="true"/>
          <FC max_credits="500000"
          min_threshold="0.20"/>
          <FRAG2 frag_size="60000" />
          <!--pbcast.STREAMING_STATE_TRANSFER /-->
          <pbcast.STATE_TRANSFER />
          <!-- pbcast.FLUSH /-->

          • 2. Re: Using TCP, Unable to reconnect. Don't know why?
            nachiket_patel

            Hi bela,
            I am having one question,

            How come sequence matters????

            Why you have not used ??

            And You pasted UDP config.
            So now i think i should refer to TCP config given in JGroups.jar.

            Thanks
            Nachiket

            • 3. Re: Using TCP, Unable to reconnect. Don't know why?
              nachiket_patel

              Hello,
              Thanks for help, now it is working.
              I am using given configuration for TCP.

              <TCP start_port="7800"
              discard_incompatible_packets="true"
              max_bundle_size="64000"
              max_bundle_timeout="30"
              use_incoming_packet_handler="true"
              enable_bundling="false"
              enable_diagnostics="true"
              use_concurrent_stack="true"
              thread_naming_pattern="pl"

              thread_pool.enabled="true"
              thread_pool.min_threads="2"
              thread_pool.max_threads="8"
              thread_pool.keep_alive_time="5000"
              thread_pool.queue_enabled="true"
              thread_pool.queue_max_size="10000"
              thread_pool.rejection_policy="discard"

              oob_thread_pool.enabled="true"
              oob_thread_pool.min_threads="1"
              oob_thread_pool.max_threads="8"
              oob_thread_pool.keep_alive_time="5000"
              oob_thread_pool.queue_enabled="false"
              oob_thread_pool.queue_max_size="100"
              oob_thread_pool.rejection_policy="Run"/>

              <!--<TCPPING timeout="3000"
              initial_hosts="${jgroups.tcpping.initial_hosts:150.0.149.105[7800]}"
              port_range="1"
              num_initial_members="1"/> -->

              <!--<TCPGOSSIP initial_hosts="150.0.149.105[5555]" gossip_refresh_rate="10000"
              num_initial_members="1" />-->

              <PING gossip_host="150.0.149.105" gossip_port="5555" gossip_refresh="5000"
              timeout="2000" num_initial_members="1"/>

              <MERGE2 max_interval="30000" min_interval="10000"/>
              <FD_SOCK num_tries="3" suspect_msg_interval="3000"/>
              <FD timeout="3000" max_tries="4" shun="true"/>
              <FD_ALL/>
              <VERIFY_SUSPECT timeout="1500" />

              <pbcast.NAKACK use_stats_for_retransmission="false"
              exponential_backoff="150"
              use_mcast_xmit="true" gc_lag="0"
              retransmit_timeout="50,300,600,1200"
              discard_delivered_msgs="true"/>



              <pbcast.STABLE stability_delay="1000" desired_avg_gossip="40000"
              max_bytes="1000000"/>
              <VIEW_SYNC avg_send_interval="60000" />
              <pbcast.GMS print_local_addr="true" join_timeout="3000"
              shun="false" view_bundling="true" view_ack_collection_timeout="2000"/>
              <FC max_credits="500000" min_threshold="0.20"/>
              <FRAG2 frag_size="60000" />
              <!--pbcast.STREAMING_STATE_TRANSFER /-->
              <pbcast.STATE_TRANSFER />
              <!-- pbcast.FLUSH /-->
              <pbcast.FLUSH timeout="0"/>



              ----------------------------------------------------
              But, when i update some

              • 4. Re: Using TCP, Unable to reconnect. Don't know why?
                nachiket_patel

                Hello,
                Thanks for help, now it is working.
                I am using given configuration for TCP.

                <TCP start_port="7800"
                discard_incompatible_packets="true"
                max_bundle_size="64000"
                max_bundle_timeout="30"
                use_incoming_packet_handler="true"
                enable_bundling="false"
                enable_diagnostics="true"
                use_concurrent_stack="true"
                thread_naming_pattern="pl"

                thread_pool.enabled="true"
                thread_pool.min_threads="2"
                thread_pool.max_threads="8"
                thread_pool.keep_alive_time="5000"
                thread_pool.queue_enabled="true"
                thread_pool.queue_max_size="10000"
                thread_pool.rejection_policy="discard"

                oob_thread_pool.enabled="true"
                oob_thread_pool.min_threads="1"
                oob_thread_pool.max_threads="8"
                oob_thread_pool.keep_alive_time="5000"
                oob_thread_pool.queue_enabled="false"
                oob_thread_pool.queue_max_size="100"
                oob_thread_pool.rejection_policy="Run"/>

                <!--<TCPPING timeout="3000"
                initial_hosts="${jgroups.tcpping.initial_hosts:150.0.149.105[7800]}"
                port_range="1"
                num_initial_members="1"/> -->

                <!--<TCPGOSSIP initial_hosts="150.0.149.105[5555]" gossip_refresh_rate="10000"
                num_initial_members="1" />-->

                <PING gossip_host="150.0.149.105" gossip_port="5555" gossip_refresh="5000"
                timeout="2000" num_initial_members="1"/>

                <MERGE2 max_interval="30000" min_interval="10000"/>
                <FD_SOCK num_tries="3" suspect_msg_interval="3000"/>
                <FD timeout="3000" max_tries="4" shun="true"/>
                <FD_ALL/>
                <VERIFY_SUSPECT timeout="1500" />

                <pbcast.NAKACK use_stats_for_retransmission="false"
                exponential_backoff="150"
                use_mcast_xmit="true" gc_lag="0"
                retransmit_timeout="50,300,600,1200"
                discard_delivered_msgs="true"/>



                <pbcast.STABLE stability_delay="1000" desired_avg_gossip="40000"
                max_bytes="1000000"/>
                <VIEW_SYNC avg_send_interval="60000" />
                <pbcast.GMS print_local_addr="true" join_timeout="3000"
                shun="false" view_bundling="true" view_ack_collection_timeout="2000"/>
                <FC max_credits="500000" min_threshold="0.20"/>
                <FRAG2 frag_size="60000" />
                <!--pbcast.STREAMING_STATE_TRANSFER /-->
                <pbcast.STATE_TRANSFER />
                <!-- pbcast.FLUSH /-->
                <pbcast.FLUSH timeout="0"/>



                ----------------------------------------------------
                But, when i change cached object in one instance of app when network is disconnected, and when network gets enabled other instances does not get sync. But whatever manipulation i do afterward on cached objects gets updated properly in all instances. ??? what i am missing here.????

                • 5. Re: Using TCP, Unable to reconnect. Don't know why?
                  belaban

                  Good. Note that you could also replace PING with MPING but only if you can do IP multicasts

                  • 6. Re: Using TCP, Unable to reconnect. Don't know why?
                    nachiket_patel

                    No, It is not possible, i have to configure it for Wifi network, so disconnection frequency will be high, but our data is very less (400 to 2000 elements - each contains 3 to 4 primitives and very less update frequency) . So reconnection time should be minimized. Any guidance will be helpful...Thanks.

                    And, when i change cached object in one instance of app when network is disconnected, and when network gets enabled other instances does not get sync. But whatever manipulation i do afterward on cached objects gets updated properly in all instances. ??? what i am missing here.????

                    -----------------
                    I found about AUTO_RECONNECT property in JGroups, in FD's shun property documentation,
                    But how to enable it in Cache???

                    Cheers,
                    Nachiket