2 Replies Latest reply on Oct 18, 2011 7:41 AM by sandeep.narang

    Server Connection Pooling

    sandeep.narang

      Hi Team

       

      We have a requirement in which we have to do connection pooling with below scenario:

       

       

       

      We are listening to PI SDK events change value through event pipes. We have a list of servers with us arranged in priority in descending order, say Server A, Server B, Server C.

       

       

       

      Scenario:

       

      Suppose we have connected to Server A and listening to events change. In between Server A goes down. Then we need to automatically connect to server B. Same if server B goes down, we need to connect to server C. in between if server A goes up, then system should be reconected to server A.

       

       

       

      Please let us know ow we can achieve such result in OnNewVale method of event pipes. Has PI SDK in built support for this type of pooling?

       

       

       

      Thanks and Regards

       

      Sachin

        • Re: Server Connection Pooling
          dtakara

          Hi Sachin,

           

          I presume you are talking about servers on a collective, right?

           

          If that's the case, please refer to the High Availability section in the PI-SDK Help, which provides a thorough explanation of the HA features available:

           

          7838.PI_2D00_SDK-Help-_2D00_-High-Availability-section.png

           

           

           

          Sachin Puri

          Suppose we have connected to Server A and listening to events change. In between Server A goes down. Then we need to automatically connect to server B. Same if server B goes down, we need to connect to server C.

           

          For these requirements, you would be covered by the PreferPrimary option of the Server.Open method.

           

           

           

          Sachin Puri

          in between if server A goes up, then system should be reconected to server A.

           

          For this requirement, you would have to implement a custom periodic check that server A is up and force reconnection to it.

           

           

           

          Sachin Puri

          Please let us know ow we can achieve such result in OnNewVale method of event pipes. Has PI SDK in built support for this type of pooling?

           

           

          PI-SDK Help

          Note that during a failover, signups for change notification (EventPipes) on one server need to be reestablished on the next server.  During the transition period some events can be missed.  Also because replication is not instantaneous and because data delivery is fanned from input sources and there is latency (or even disconnection and buffering) between the data source and the server, the data streams between the initial connection and the new connection after a failover may not be perfectly synchronized.  For example, after failing over, the new server may not yet have seen data that was already delivered to the first server resulting in duplicate data arriving in EventPipes.  When the new server is ahead of the original server events that had not yet been delivered to the original EventPipe are already on the new server and aren't sent again.  This can result in a gap in the event stream in an EventPipe.  However, the archive of both servers eventually has the same complete history.  This behavior can be observed in ProcessBook when during a failover a gap is displayed but on refreshing the data from the new server, a continuous trace is displayed.