What is the Best Configuration for Quota in Cloud?

Not applicable

As i understand, for better Quota performance in a customer-managed deployment of Edge (aka on-premises Edge), we can turn distributed off, and then divide the desired total quota limit by the number of message processors in the Edge environment and use that divided number for the setting in the policy. For example if I have a quota of 1000 and I have 3 MPs, then I will set quota to 333 in the policy.

Can someone suggest what is the best approach for cloud?

1 2 130
2 REPLIES 2

Not applicable

Can you give some additional details on how you're thinking of configuring your quotas? For example, are you creating tiered style API products (gold/silver/platinum)? Are quotas monthly volumes or at a per-minute/hour/day level. Each will have implications in terms of turning distribution off. You also have the option to distribute the quota, but not to force synchronous checks. That reduces latency without as much of a trade off for precision of quota enforcement.

The approach you described will ALSO work for Edge in the public cloud, EXCEPT: Apigee does not guarantee a particular number of MPs for you. There's no way to know how many you will have, moment by moment. Apigee may change the number of MPs, without notice, in which case your Quota will be incorrectly configured. Therefore the approach you described works, but is strongly disrecommended.

Having said that, I think you may perhaps be trying to solve a problem that you don't really have to solve.

You want to optimize the quota performance, but... in a Edge-cloud scenario, the overwhelming factor in the overall cost (in terms of time) of a request will be the network transmission time for the request and response data. The quota policy in Apigee Edge is pretty well optimized even if it is distributed. You SHOULD ensure that the synchronous setting is false. Synchronous Quota implies a blocking quota increment, which means contention in the distributed environment. (I cannot imagine a real-world scenario where synchronous Quota makes sense, and I wish it was not part of the Edge product, frankly.)

The actual cost in terms of time of enforcing a distributed Quota in the Apigee Edge cloud will be ~1-3ms. Maybe less. Whereas your network transmission time will be 50-100ms or more. That does not count time spent in the backend server, which may be 3ms or may be 300ms. Your overall response time might be 400ms and you seem to be concerned with 1-2ms in Quota.

Take care to not spend time doing premature optimization.

Ask yourself: Am I sure that I need to optimize the performance of this particular thing?