2 of 2 people found this helpful
Thanks for reaching out to us on PI Square! Generally, I find performance issues tricky to track down so I would recommend contacting our Tech Support directly and opening up a case.
That being said, a good first step to diagnosing performance issues with the PI Web API is to use Google Chrome's Developer Tools to analyze the requests. If you take a look at one of requests in the Network Tab and select Timing sub-tab you should be able to find a breakdown of the time usage for that given request, such as the below:
If you see a high amount of time spent on "Waiting (TTFB)", then it means the browser is waiting on a response from the PI Web API. This could be due to network latency between machines and/or the PI Web API machine being highly taxed. So I would check your ping between the machines and see if this can be reduced and the network shored up as well as the CPU/RAM usage on the PI Web API node and see if this may need to be upgraded to handle the amount of requests no that your application is stood up.
If you see a high amount of time in "Content Download", then you may be able to improve the performance here by using the selectedFields category to reduce the size of your requests and thus the encoding/decoding/download time of them (it will also ease up on the resource usage by the PI Web API service).
One more thing I would recommend looking at is if you can use Batch requests to reduce the back and forth between the browser and the Web API node. You can find some resources on this topic here and here.
Again, I would recommend opening up a tech support case, but hopefully the above can get you started on the process.
In addition to Robert Schmitz suggestions, can you provide the following information? As Rob said, going to Tech Support would speed up the resolution.
Which version of the PI Web API are you running ?
How much data is retrieved by a user using the website in 1 request? How many event frames, how many attributes, what's the time range?
If a user creates event frames, how many event frames can they check in by request?
Also, what's the total number of Event Frames in this customers AF Server? You can see this information in PI System Explorer > Server Properties > Count ?
As long as your PI Web API server has more than 1 processing core, the following should improve PI Web API performance.
From the PI Web API installation folder, open the PI Web API configuration file, OSIsoft.REST.Host.exe.config. Typically, the PI Web API installation folder is C:\Program Files\PIPC\WebAPI.
Edit the runtime element to include the child element gcServer with the enabled attribute set to true, as shown in the following example.
<?xml version="1.0" encoding="utf-8"?>
Robert Schmitz you where right "waiting ttfp" need most time, CPU/RAM usage has never more than 20 %, network usage is at 0,2% last 24 hours, ping is under 1 ms.
It is possible to specify the problem in more detail.
IIS, AF and PI WEB API are on same server.
- PI Web API is 2017 Version 126.96.36.1996
- 1 Request returns ~20 event frames (filtered by Template at request) needs up to 15 sec
another request has 20 different requests to Web API and it needs nearly same time may one or two secondes longer.
- Default time range is about last 6 months. Same request time for shorter ranges
- Event frames count is now at 17.000
1 of 1 people found this helpful
Those are very small numbers. Is there a large number of attributes per Event Frame template? Do any of the attributes have expensive table lookup data references or formulas?
I think the next best step is to open a support case. Can you come back to this post with the solution once it's been discovered with the assistance of our support engineers?