Apigee Edge - 4MV4D - Quota Policy - Flexi Type - S02E08

Hello Apigeeks,

In this 4MV4D, Find out how flexi type Quota policy works in Apigee Edge hands-on. In general Quota policy works based on interval & resetting the Quota / starting the quota counter from fresh at the start of the GMT time minute / hour / day / month once the interval reaches the defined limit. For example, If you say 2 requests / minute. Quota reset at the start of next minute 0th second of GTM time.

In flexi type, Quota counter starts when Apigee Edge receives first request within the interval. Quota counter doesn’t start at GMT time start of the minute / hour / day / month, Instead it starts based on the first request time.

See Quota Policy used in this 4MV4D video below that shows Quota Policy flexi type in action.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Quota async="false" continueOnError="false" enabled="true" name="Quota-1" type="flexi">
    <DisplayName>Quota-1</DisplayName>
    <Properties/>
    <Allow count="4"/>
    <Interval>1</Interval>
    <Distributed>true</Distributed>
    <Synchronous>true</Synchronous>
    <TimeUnit>minute</TimeUnit>
</Quota>
	

To see it in action , Open https://time.is/GMT link to see present GTM time in seconds. Set the quota policy to 4 / minute.

Let’s see an example what happens by default in Quota Policy default type,

Present time is 08:30:40 AM, Quota is 4 / minute

  • First request, 08:30:42 AM - Allowed
  • Second request, 08:30:43 AM - Allowed
  • Third request, 08:30:44 AM - Allowed
  • Fourth request, 08:30:45 AM - Allowed
  • Fifth request, 08:30:46 AM - Blocked - Quota Rate Limit Error
  • 08:31:00 AM - Quota Resets
  • Request at 08:31:00 AM - Allowed

In flexi type, Quota counter starts at first request, Present time is 08:30:40 AM, Quota is 4 / minute - Flexi Type

  • Request at 08:30:50 AM - Allowed
  • Request at 08:30:55 AM - Allowed
  • Request at 08:31:01 AM - Allowed
  • Request at 08:31:02 AM - Allowed
  • Request at 08:31:02 AM - Blocked - Quota Rate Limit Error
  • Quota counter resets at 08:31:50 AM

As you can see quota counter didn’t get reset at start of the minute instead it will reset 1 minute from start of the first request.

4MV4D videos are completely focussed on API Developers & Help you learn many interesting concepts very quickly using hands-on approach. Don't forget to subscribe to channel here & share same with your friends / colleagues who are interested in Apigee.


Feel free to send your feedback/queries using comments below or Ask a question if you have any query. Stay tuned for more videos.

Version history
Last update:
‎03-09-2017 10:24 PM
Updated by: