- Neueste
- Die meisten Stimmen
- Die meisten Kommentare
When you encounter a ProvisionedThroughputExceededException while using Amazon Rekognition's DeleteFaces operation, it means you've exceeded the throughput limits for your account in that region.
Looking at your code, I can see you're already implementing some best practices like chunking your requests (1000 faces per call) and adding sleep intervals between calls (2 seconds). However, you're still hitting throughput limits.
Here are some suggestions to solve this issue:
-
Increase the sleep time: Try increasing your sleep interval between calls from 2 seconds to 5 or even 10 seconds to reduce your request rate further.
-
Implement exponential backoff: Instead of a fixed sleep time, implement an exponential backoff strategy where you progressively increase the wait time between retries.
-
Reduce batch size: Try reducing your batch size from 1000 faces to a smaller number, such as 500 or 250 faces per request.
-
Contact Amazon Rekognition: The error message specifically mentions "If you want to increase this limit, contact Amazon Rekognition." You can request a service limit increase through AWS Support if you need higher throughput.
-
Implement more robust error handling: Your current retry logic only attempts once after a throughput exception. Consider implementing multiple retries with increasing backoff periods.
While the documentation may indicate that you can delete up to 4096 faces per call and make 5 requests per second, these limits might vary based on your specific account settings, region, or other factors. The actual throughput you can achieve might be lower than the documented maximum.
Sources
DeleteFaces - Amazon Rekognition
Amazon Rekognition examples using SDK for .NET - AWS SDK Code Examples
Use DeleteFaces with an AWS SDK or CLI - Amazon Rekognition
