Skip to content

Data-Sorting Process Takes time with OpenSearch

0

Hey AWS team,

I have one E-commerce site which has more than 3 lakh products. I can see when I list the products it takes some time around 2-3 secs. On the first page I shows 50 products, when I filter the products by the price, it takes 30-40 secs of time. Anyone can help me with the solution how can I resolve it. I am sharing the OpenSearch details.

  • Availability Zone(s) => 1-AZ without standby
  • Instance type => r7g.large.search
  • Number of data nodes => 3
  • EBS volume size (GiB) => 60 GP3
  • UltraWarm data nodes enabled => No
  • Field data cache allocation => 50
  • Max clause count => 4096
  • OpenSearch Version => 2.13

asked a year ago267 views

1 Answer
1

The performance issues you're experiencing with your OpenSearch setup for your e-commerce site are not uncommon, especially when dealing with a large number of products and complex sorting operations. Here are some suggestions to improve your query performance:

  1. Optimize your query: The slow response time when filtering by price suggests that your query might not be optimized. Consider using a range query for price filtering instead of terms query if you haven't already.

  2. Indexing strategy: Ensure that the fields you're frequently sorting or filtering on (like price) are properly indexed. You might want to consider using a sorted index on frequently used sort fields.

  3. Increase resources: While your current setup (3 r7g.large.search nodes) is decent, you might benefit from increasing the number of data nodes or using more powerful instance types, especially if you're dealing with complex queries and large datasets.

  4. Shard allocation: With 3 lakh (300,000) products, you might want to review your shard allocation. Ensure you have an appropriate number of shards for your data volume.

  5. Caching: Implement and optimize caching strategies. This could include query caching, filter caching, and field data caching.

  6. Use of scroll API: For large result sets, consider using the scroll API instead of deep pagination.

  7. Upgrade consideration: While you're on a recent version (2.13), always keep an eye on newer versions that might offer performance improvements.

  8. Monitor and tune: Use Amazon CloudWatch to monitor your cluster's performance and identify bottlenecks. You may need to adjust JVM settings or other cluster settings based on your specific workload.

  9. Consider using OpenSearch Optimized Instances: These are designed to improve performance for heavy indexing use cases and could potentially help with your scenario.

Remember, performance tuning is often an iterative process. You may need to experiment with different configurations to find the optimal setup for your specific use case.
Sources
OpenSearch slow returning a big result set | AWS re:Post
Optimizing query performance for Amazon OpenSearch Service data sources - Amazon OpenSearch Service
Improve your Amazon OpenSearch Service performance with OpenSearch Optimized Instances | AWS Big Data Blog

answered a year ago

EXPERT

reviewed 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.