5 Replies Latest reply on Sep 10, 2013 11:40 AM by Marcos Vainer Loeff

    UpdateValues() Performance


      I am using the PI SDK (v1.4.2.445) UpdateValues() method. I am sometimes experiencing a delay of 15ms or 16ms inside the function. This is causing a performance problem for my application. Some of the method calls take less than 1ms to complete. Normally there are only 2 values passed into the function. I have 2 worker threads, each thread has its own instance of the PI SDK IPISDKPtr object and each thread is connected to a different PI Server. I am only getting about 100 calls to the UpdateValues() per seconds. I would like about double that. Is this a known problem/limitation? Is there a way of getting better performance?

        • Re: UpdateValues() Performance

          @John: UpdateValues method is meant to allow bulk calls, so you can write/update many values at the same time (meaning a single RPC call to the PI Data Archive). The new PI Data Archive 2012 can sustain an input rate of 1 million events per second (and more). Although, this is not 1 million RPCs this needs to be done the right way. Bulk methods should be used to allow this. How many values are stored within your PIValues object?


          You are saying that the delay of 15-16 ms is causing issue with your application, what do you mean? Are you trying to control a loop? a piece of equipment? The PI System should not be considered as a control system to turn on/off or shutdown equipment that might be critical. The event flow of the PI System is not deterministic and does not offer a guarantee of feedback of the equipment you want to control.


          The variation of time you would notice for the calls to complete is multiple:

          • network latency
          • connection failover if used with a high availability PI Data Archive
          • buffering enabled
          • disk I/O
          • machine resources

          To improve the performance there are many options that you have. I suggest you take a look at this white paper on optmizing PI SDK applications. Also, you can do the same with AF SDK (RDA). You can easily do a search on vCampus to find many posts on the subject.

            • Re: UpdateValues() Performance

              To get 100 calls per second using PI SDK UpdateValues you must be buffering already, and that timing will be the timing for the PI SDK to offload to the values to the local buffer queue. The timing won't be for the data to hit the PI Server in that scenario. Even if the timing is for direct to PI Server, is the PI Server on the same node?


              Sounds like a FFT type interface based on data rates...

              • Re: UpdateValues() Performance

                Hello Mathieu.


                Thank you very much for your comments, they are very helpful.


                I am storing only one or two values within the PIValues object.


                In relation to the 15-16ms delay, I am not trying to control a loop or a piece of equipment. The delay is causing a problem because the application cannot keep up with the number of analogue updates I am experiencing on the production SCADA system.


                It sounds like you are not surprised I am getting 100 calls per second. Maybe I need to do some caching in my application to reduce the number of calls to UpdateValues(), include more values in each call.


                I have browsed the white paper in the past, I will read it again in more detail.


                I have read about the AF SDK in the past and the function allowing multiple tags and multiple values to be provided looks very useful.