What is making /stats api slow? What can I do as a client to improve performance?

I have observed that for bigger time range, stats Api response is slow, though data it returned was few KBs.

What are the factors which add to the response time of the Api?

Does number of dimensions queried, increases response time?

Does filter expression like "notin" and "in" are better (response time-wise) then getting data without any filter?

Where it is deployed region-wise? I would like to keep my client deployment in the same location.

0 2 193
2 REPLIES 2

Metrics, dimensions, time range and filters in the query all would impact stats API response time. Usually we recommend using async queries for query time range more than 14 days. (https://docs.apigee.com/api-platform/analytics/asynch-reports-api) This feature is only available for cloud customers. Would you mind sharing the query you use so that we can investigate further for your use case?

The services are deployed in multiple regions. Our routing strategy should take care of optimizing the latency between client and service application.

https://api.enterprise.apigee.com/v1/organizations/<org>/environments/<env>/stats/8 custom dimension,6 standard dimension?_optimized=js&limit=14400&timeRange=02/25/2020%2000:00:00~02/26/2020%2023:59:00&select=sum(message_count)&filter=(customDimension in '')