# OpenSearch Shard Calculator AI Agent Connect

> Deterministic AWS OpenSearch shard distribution and resource allocation calculator.

## Overview
- **Category:** infrastructure
- **Price:** Free
- **Endpoint:** https://edge.vinkius.com/vk_preview_vczGy4dWf3ll3CPZeUPgSA2AoDNVpa6IQ4JK6bmA/ai-agent-connect
- **Tags:** opensearch, aws, sharding, cluster-management, devops

## Description

This MCP server provides precise calculations for AWS OpenSearch cluster architecture. Use `calculate_shard_distribution` to determine primary and total shard counts based on your index size and target shard size. Use `calculate_cluster_limits_and_health` to evaluate shard density per node and overall cluster stability. Finally, use `recommend_resource_and_performance_settings` to obtain optimized JVM heap sizes, garbage collection recommendations, and refresh intervals for your specific workload. It helps prevent common issues like excessive shard density or undersized JVM heaps.

## Tools

### calculate_cluster_limits_and_health


### calculate_shard_distribution


### recommend_resource_and_performance_settings


## Prompt Examples

**Prompt:** 
```
I have 500 GB of data across 10 indices. I want each shard to be 30 GB. How many shards do I need and how many replicas should I consider?
```

**Response:** 
```
For 500 GB across 10 indices with a 30 GB target, you will need 17 primary shards in total (2 per index, rounded up). If you use 1 replica, your total shard count will be 34.
```

**Prompt:** 
```
My OpenSearch node has 64 GB of RAM. I am running a write-heavy workload. What are my recommended settings?
```

**Response:** 
```
For a 64 GB instance with a write-heavy workload, the recommended JVM heap size is 32 GB. It is recommended to use the G1GC garbage collector, and you should increase the refresh interval to accommodate high indexing volume.
```

**Prompt:** 
```
I have 5000 total shards across 5 data nodes. Is this a problem?
```

**Response:** 
```
With 5000 total shards across 5 nodes, you have 1000 shards per node. This is at the upper limit of the recommended density and may impact performance.
```

## Frequently Asked Questions

**How do I know if my shard density is too high?**
You can use the `calculate_cluster_limits_and_health` tool. It will return a flag if the shards per node exceeds the recommended limit of 1000.

**Can this tool recommend JVM settings?**
Yes, the `recommend_resource_and_performance_settings` tool provides optimized JVM heap size, recommended garbage collection algorithms like G1GC, and translog flush thresholds.

**What is the recommended shard size for OpenSearch?**
A good rule of thumb is to target a shard size between 10 and 50 GB. You can use `calculate_shard_distribution` to see how your specific index size fits these targets.
