2 of 2 people found this helpful
It is possible to make bulk calls with the PI Web API.
50k points at the time may be a little on the high side though and I doubt the application need to show to the user 50k points at the same time .
I would start with 1000, and see how it goes.
You may look at the SteamSet controller:
You can pass the webId parameter several times: ?webId=...&webId=...
Limit on the lenght of URL
When making bulk queries, you may quickly face a limitation with the max lenght of the URL. You can get around the url length limitation by sending a POST request and passing the long URL into a request header like this:
X-PIWEBAPI-RESOURCE-ADDRESS : https://localhost/piwebapi/streamsets/value?webid=...&webid=...
X-PIWEBAPI-HTTP-METHOD : GET
This is applicable to all PI Web API calls.
You can send multiple WebId to StreamSet, but as you said there is limitation on max lenght of the URL.
I uses Batch and StreamSet together to get 50,000 point values. It returns all values with just one call.
The performance is not good enough for our usage thou.
Can you please give more details about what is the usage of the data you need to transfer? This should help understanding and maybe make better recommendations.
I would say that PI Web API nature is best suited for web clients and applications that interacts with a user. It was not developed for high volume data transfers.
If your situation required to transfer massive amounts of data you may be better consider other technologies such as PI AF SDK or one of our PI Integrators.
With a bit more information we may be able to find something that could work for you here are some questions to help understanding:
- Is the PI Web API instance facing the internet or intranet? if this is in intranet maybe there are other options we could use (PI AF SDK)
- Is PI web API a requirement?
- Why do you need to get 50k point values at once?
I am looking forward for more details,
As you mentioned it was my conclusion that PI WebAPI is not sufficient for using in a service that tries to read large number of point values. I am going to use PI AF SDK.
Thanks a lot for information.
While PI AF SDK is faster than PI Web API, there is at least one one crucial factor: PI AF SDK is only for Windows applications. If you have cross platform or mobile needs, PI Web API is the recommended technology.
Yes, I am aware of that.
1 of 1 people found this helpful
Data transfers for high volumes of data can be challenging.
As PI AF SDK might be a better choice in your situation, here are a few resources you should look at:
Handling a lot of elements efficienlty:
Handling data gathering efficiently:
This last one is a command line application that writes data from PI Data Archive into text files. One could modify it to use data from AF instead.
I am pointing it our because it illustrates a few concepts:
- Bulk reads: to group tags together in a single network call to gather the data
- Chunking : splits data collection into subsets of N tags, this is more efficient and also make sure application is not consuming too much memory
- A dedicated queue to optimize write time
Help this helps,
These are good resources.
Note that even when using the GET as a POST, the X-PIWEBAPI-RESOURCE-ADDRESS header is till subject to the server's limit as set in the MaxFieldLength registry entry:
This is typically 16KB
Hi, just dug this post up in a search. Trying to avoind running into this issue, i wonder if the registry setting for HTTP services as noted in this microsoft support post is in any way related to the PI Web API? Is that because the PI Web API uses the underlying .NET framework that uses this setting?
In other words, are we sure this setting controls this the size limit of a PI Web API POST request?