- Newest
- Most votes
- Most comments
The time taken for AWS to refresh the remaining quota for an API can vary, and it's not always instantaneous. In your case, experiencing a delay of about half an hour is not uncommon.
AWS quota systems are designed to handle large-scale operations, and as a result, there can be some latency in updating and propagating quota information across their systems. This delay can affect the accuracy of quota monitoring tools and functions, like your Lambda function.
To address this issue and improve your monitoring system, consider the following approaches:
-
Implement a buffer in your Lambda function to account for potential delays in quota updates. For example, you might want to set your alert threshold slightly higher than the actual critical level.
-
Use the AWS API Gateway's get_usage method to retrieve the most up-to-date usage data directly, rather than relying solely on the displayed quota in the console.
-
Implement a cumulative tracking system in your Lambda function. Instead of relying only on the AWS-reported remaining quota, keep a count of the requests your system has made and use this in conjunction with the AWS-reported data.
-
Set up CloudWatch alarms on your API usage metrics. These can often be more responsive than manually checking quotas and can trigger notifications or actions when usage approaches your defined thresholds.
-
If your use case requires more immediate quota updates, you might want to contact AWS support to discuss your specific needs and see if there are any solutions or workarounds available for your particular situation.
Remember, while AWS strives to provide real-time data, some level of delay in quota updates is normal due to the scale and complexity of their systems. Designing your monitoring and alerting systems with this potential delay in mind will help ensure more reliable operations.
Sources
How long to wait for a response to a quota increase reply? | AWS re:Post
Adjust limit of API Key for API Gateway | AWS re:Post
REL01-BP04 Monitor and manage quotas - Reliability Pillar

For me, lambda is only an option because I have to send 3 emails in case when usage quota reaches 50%,80% and 100%. I do use Getusageasync method to get the remaining usage. The threshold in lambda to check the usage is set to 5 min.