AnsweredAssumed Answered

PIWEBAPI - Batch Call - Python - Parallel Queries

Question asked by catronro on Mar 31, 2020
Latest reply on Apr 30, 2020 by gregor

I am trying to achieve some level of parallelism in my piwebapi queries


After reading this paper: 


It mentions: “Additionally, with Batch requests, the PI Web API is capable of optimizing non-dependent sub-requests in the body of a batch controller call to run in parallel, so it can process multiple sub-requests simultaneously if they don’t depend on one another.”


Based on the above i implemented the batch request as follows:


{0: {

'Method': 'GET',

'Resource': ' 00:00:00&endtime=3/7/2020 16:00:00&interval=1s'},

1: {

'Method': 'GET',

'Resource': ' 00:00:00&endtime=3/7/2020 16:00:00&interval=1s'},

2: {

'Method': 'GET',

'Resource': ' 00:00:00&endtime=3/7/2020 16:00:00&interval=1s'},

3: {'Method': 'GET',

'Resource': ' 00:00:00&endtime=3/7/2020 16:00:00&interval=1s'}



When I test this call performance compared to just looping through 4 independent streamset calls i get performance within 2 seconds of each other. Which is unexpected if the batch call is truly parallelizing the calls.


Is there some parameter i need to set in the call to get batch to parallelize the calls? Perhaps there is a main setting in the API itself i need to check?