Skip to content

Opensearch Serverless - 429 Too many requests on Search queries.

0

Hello,

We have two AWS opensearch collections on our account. 1 collection has 22 indices (total size: ~ 52 GiB) and the other has 28 indices (total size: ~610 GiB). Recently we had to remove some data and reindex it in one of the collections. (Close to 200 GiB of the data in the second collection). We finished reindexing two weeks ago and during that time we were getting a lot of 429 too many requests errors for search queries. We thought it was because of reindexing and reduced traffic and it was working all good after 2 days (No 429 too many request errors). But now the error is reoccurring after 2 weeks and I wanted to know if there was a way we could monitor shard distribution for serverless collections. Or if you could guide me better methods to debug the issue.

Also, do the search OCUs only scale up when consistent latency is higher, because I don't see the OCUs getting scaled up when there is consistent throttling error happening. OCU usage As you can see in the image even though our OCUs we have set higher limits than current usage, we just get throttling errors instead of upscaling (Not sure if upscaling would help).

I can provide more information if you think it could help understand the issue. Let me know.

Thanks a lot Chirag

asked a year ago631 views

2 Answers
0

When you're experiencing 429 "Too Many Requests" errors with OpenSearch Serverless despite having set higher OCU limits, there are several factors to consider.

First, it's important to understand that OpenSearch Serverless maintains a minimum of 4 OCUs (2 for indexing and 2 for search) for each collection, even when there's no activity. The system scales automatically based on various factors including data size, query complexity, and request patterns - not just request rate.

The 429 errors you're seeing indicate that your search requests are being throttled. This can happen when:

  1. The SearchOCU limit has been reached (HTTP 402 error)
  2. The current OCUs are overloaded by complex queries or high volume (HTTP 507 error)
  3. There's a temporary spike in requests that exceeds capacity before scaling can occur

For your specific situation with large collections (52 GiB and 610 GiB), the system may need time to scale up when demand increases. There can be a delay between when throttling begins and when additional resources are deployed.

To debug and address this issue:

  1. Implement an exponential backoff retry policy in your application to handle these throttling errors gracefully
  2. Monitor CloudWatch metrics for SearchRequestRate alongside your SearchOCU usage
  3. Check if your queries are particularly complex or resource-intensive
  4. Consider if your workload patterns have changed (even if total request volume is similar)
  5. Evaluate if your current OCU limits are appropriate for your workload

Unfortunately, OpenSearch Serverless doesn't provide direct visibility into shard distribution as it manages this internally. The service is designed to handle scaling automatically, but there can be situations where the scaling doesn't happen quickly enough to prevent throttling.

If the issue persists, you might want to consider optimizing your queries, implementing better request batching, or requesting a quota increase if you consistently need more capacity.
Sources
AWS OpenSearch SearchOCU keeps hitting the max limit | AWS re:Post
OpenSearch Serverless OCU usage too high | AWS re:Post
Tutorial: Getting started with Amazon OpenSearch Serverless - Amazon OpenSearch Service

answered a year ago

0

Hey,

Hope you're keeping well.

429 errors in OpenSearch Serverless usually indicate the service is throttling due to exceeding concurrency or throughput limits, not just total OCU quota. OCUs scale primarily based on sustained latency under load, but if queries spike suddenly or if shard distribution causes uneven load, scaling may not happen instantly. You can monitor search OCU usage and throttling metrics in CloudWatch → AWS/OpenSearchServerless → SearchOCUUtilization and RequestThrottleCount to correlate traffic patterns.

Thanks and regards,
Taz

answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.